A. ([info]aery) wrote in [info]absonant,
@ 2006-04-09 14:27:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:base: smooth sailing, design: sidebar, style system: two, theme: spring kiss, tutorials: width and positioning

[tutorial] adjusting width and positioning.
Theme: Spring Kiss
Style system: 2
Base: Smooth Sailin'
Design: One sidebar


This tutorial will show you how to make your entries wider or less wide, and also how to de-center and reposition it. Prior CSS knowledge could come in handy but is not necessary:
I. customizing the width
II. customizing the width of the sidebar
III. de-centering the journal

------

I. Customizing the width
Open up your CSS file in a text editor and find the following passage:

.pageblock {
padding: 2px;
position: relative;
width: 800px;
left: 50%;
margin-left: -400px;
background-color: #FFFFFF;
}

You can change 800px to anything you wish. However, to keep it centered, you must make sure that the number after margin-left: equals half of the width. If, for instance, I only want my journal to be 700px wide, I would change it to:

.pageblock {
padding: 2px;
position: relative;
width: 700px;
left: 50%;
margin-left: -350px;
background-color: #FFFFFF;
}

II. Customizing the width of the sidebar
Now, if my journal is less wide, I might want my sideboxes less wide, too. For that, I'll need this passage:

.sidebox {
width: 230px;
background-color: #F5F5F5;
padding: 2px;
margin-right: 10px;
margin-bottom: 10px;
border: 1px dotted #e4e4e4;
padding-bottom: 5px;
}

If I want my sideboxes to be only 200px in width, I simply change the code accordingly:

.sidebox {
width: 200px;
background-color: #F5F5F5;
padding: 2px;
margin-right: 10px;
margin-bottom: 10px;
border: 1px dotted #e4e4e4;
padding-bottom: 5px;
}

You do not need to alter the width of the entries as well. They adjust themselves automatically. Now there is another problem though - when you make the sidebar thinner, the calendar exceeds the width of the sidebar. To change that, you'll need to find these passages:

#latestmonth table {
position: relative;
left: 50%;
margin-left: -120px;
}

#latestmonth td {
padding: 5px;
}

By decreasing the padding, you can make the calendar less wide. To keep it in the middle of the sidebox, you'd also have to adjust the margin-left, though. For a sidebar of 200px wide, the code would look like this:

#latestmonth table {
position: relative;
left: 50%;
margin-left: -90px;
}

#latestmonth td {
padding: 1px;
}

This means that there are limits for how thin you can make your sidebar if you wish to keep the calendar sidebox. You can also hide your calendar by going to the customization area.

III. De-centering the journal
To de-center everything, you need the same passage as you used for altering the width:

.pageblock {
padding: 2px;
position: relative;
width: 800px;
left: 50%;
margin-left: -400px;
background-color: #FFFFFF;
}

You can now play around with the left and margin-left values until your journal is positioned in the way you like it.

------

Got questions?




(Post a new comment)


[info]ledbylove
2006-04-10 03:20 pm UTC (link)
I lessened the width of my sidebar, but the calendar is off center and wider than the rest of the sidebar. Any ideas?

(Reply to this)(Thread)


[info]aery
2006-04-10 04:12 pm UTC (link)
Someone else has pointed that out to me as well, I'll add a section to this tutorial later tonight, is that okay?

(Reply to this)(Parent)(Thread)


[info]ledbylove
2006-04-10 04:15 pm UTC (link)
perfectly fine :) thanks!

(Reply to this)(Parent)(Thread)


[info]aery
2006-04-10 05:33 pm UTC (link)
It has been added. I hope it was clear enough, if you have any further questions, just let me know, mmkay?

Thanks for pointing it out.

(Reply to this)(Parent)(Thread)


[info]ledbylove
2006-04-11 06:40 am UTC (link)
Looks awesome!

One last thing I noticed is that on the reply to comment page (which I view in the style since I have a paid account), the bottoms are overlapping each other. I don't know if it's in all browsers, but it's that way on both Firefox and Safari for Mac. I'm going to poke around the CSS and see if I can figure out a fix :)

(Reply to this)(Parent)(Thread)


[info]aery
2006-04-11 08:31 am UTC (link)
I haven't added any CSS for the comments pages, so it's quite likely that there are some errors. A friend gave me access to a paid account though, so I'll be able to add the code soonish. But knowing you, I think you're perfectly capable of figuring it out yourself =).

(Reply to this)(Parent)(Thread)


[info]ledbylove
2006-04-11 08:37 am UTC (link)
There was some stuff in the input class css that was messing with the formatting of the text boxes on the comment pages... so I just removed some things from that and it's looking much better now :)

(Reply to this)(Parent)(Thread)


[info]bijou
2006-08-04 05:20 am UTC (link)
hey, i was wondering if you had that code to fix the comment page?? :)

(Reply to this)(Parent)


[info]firelement
2006-04-12 07:35 pm UTC (link)
Thanks so much for the tutorials :)

How would I had more categories to my sidebar? and is there a way to get rid of the Search box?

(Reply to this)(Thread)


[info]aery
2006-04-13 06:45 pm UTC (link)
You can edit both of those using the usual customization area. Just go to sidebar and follow the instructions of LJ.

(Reply to this)(Parent)(Thread)


[info]firelement
2006-04-13 07:00 pm UTC (link)
LOL Thanks! I must have just looked over it ...

Thanks again for the Theme and Tutorials!!!

(Reply to this)(Parent)


[info]poulpette
2006-04-22 11:22 pm UTC (link)
There's better options for centering the LJ though, by using the auto value for both margin-left and margin-right in the pageblock rule and by adding text-align:center; to the body rule (without forgeting to re-set it to text-align:left; in the pageblock rule afterwards).

Like that you don't need to play with negative margins and have no maths to do to know how much margin you'll have to use to center. And additional benefit, it works with all size of windows ;)

Though I am curious, why negative margins? I tend to avoid it most of the time so I'd be interested to know about the why of your choice...

*hmmm was just passing by I hope I didn't offend you with my comment* Nice tut though ;)

(Reply to this)(Thread)


[info]aery
2006-04-23 08:16 am UTC (link)
There's better options for centering the LJ though, by using the auto value for both margin-left and margin-right in the pageblock rule and by adding text-align:center; to the body rule (without forgeting to re-set it to text-align:left; in the pageblock rule afterwards).

I know! I only just figured that out last week or so, but it doesn't seem to work properly in all cases. However, margin: 0px auto; seems to work perfectly, so I'll be updating the tutorial soon.

Though I am curious, why negative margins? I tend to avoid it most of the time so I'd be interested to know about the why of your choice...


Well, because up until somewhere last week, I wasn't aware of the other option. And this one, with the negative margins, also centers it in all resolutions. So no conscious choice. Like you, I also am not all that fond of using margins, especially since IE tends to mess them up.

*hmmm was just passing by I hope I didn't offend you with my comment*

Of course you did not. Thank you.

(Reply to this)(Parent)(Thread)

a little question
(Anonymous)
2006-04-25 05:11 am UTC (link)
Thank you very much!!!! The tutorials and the spring layout helped me a lot!!!
But what if i want to make a "links list" inside the sidebar?????
Thanks again!!!!

(Reply to this)(Parent)


[info]xfelinaa
2006-04-27 03:37 am UTC (link)
.. i'm using spring kiss & i don't understand why it doesn't show the line under the title? It is because it's not a table?

*sorry for my bad english if i seem to be not very clear :\*

(Reply to this)(Thread)


[info]aery
2006-04-28 11:52 pm UTC (link)
It's because you use Internet Explorer, probably. I can not fix it, I'm sorry.

(Reply to this)(Parent)(Thread)


[info]xfelinaa
2006-05-01 06:21 pm UTC (link)
you're right I see the line with firefox!

(Reply to this)(Parent)


[info]aaskie
2006-05-01 11:55 am UTC (link)
Hey. Thank you so much for the template. Using it on my personal journal at [info]aaskie in case you want to see what I did with it. Credited you. Added a button in my info.

(Reply to this)


[info]ghostanatomist
2006-05-06 06:20 am UTC (link)
Question, I can't find where to get the css for this template.

Thanks

(Reply to this)


[info]ghostanatomist
2006-05-07 03:16 am UTC (link)
never mind i found it. Lmao.

(Reply to this)


[info]sillyselo
2006-05-26 11:03 am UTC (link)
i downloaded this n i'm pretty sure i commented that i took it but i can't seem to find it. :? well thanksies (again)

(Reply to this)


[info]mykindascene
2007-04-12 05:55 am UTC (link)
I really like this template, I'm using it from now on, got sick of my old one.

The tutorials, infomation etc... helped me a lot and therefor had no problems. I'm not a whiz at CSS but I know enough to get by I guess. So thankyou.

(Reply to this)


[info]queensjoy
2008-03-09 05:07 am UTC (link)
can you buy any chance tell me how to fix the width of a profile page? everything I've tried just screws with the hole set up. i noticed you were able to do that for your profile... help?

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…