Carrie ([info]carriep63) wrote in [info]everything_lj,
@ 2005-08-18 23:51:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Everybody's favorite layout (new sidebar tutorial)
I had it in my head to revamp our existing sidebar tutorial with a few "upgrades" and ended up writing a whole new code. This is more than just a sidebar tutorial. I have taken everyone's favorite layout (EFL) and came up with this.

This code will put your content in the middle of the page. If you want a layout that is on the left side of the page, do not use this tutorial! Left-aligned sidebar tutorial

  • Here is an example of EFL
  • EFL has a header image, a sidebar, hidden navigation and hidden icon.
  • The text is justified in the entries and in the sidebar
  • The entries are on top of the header in both Internet Explorer and in Mozilla Firefox.
  • Images are easier to put in the sidebar.
  • You STILL NEED A WEBSITE listed in your userinfo!
  • This is for the S1 Generator style
  • This tutorial deals only with the main entries page. You will need a FRIENDS_WEBSITE, DAY_WEBSITE and CALENDAR_WEBSITE override to match your layout across all pages. (Read More)
  • Remember to Keep your numbers even!
To move your content to the right and left, change your margin-left number!**see below**


GLOBAL_HEAD<=
<style type="text/css">
<!--

/* MOVE ENTRIES DOWN */
body{
margin-top:200px;
}



/*GETS RID OF ICON*/
.shadowed img{
display:none;
}


/*HIDES YOUR NAVIGATION*/
table table table table .meta {visibility:hidden;position:absolute;top:1px}
table table table table table .meta {visibility:visible;position:relative;top:1px}

tr.caption{
display:none
}
.shadowed td div{
visibility: hidden;
position: absolute;
top: 1px
}



/*POSITION YOUR HEADER*/
#x{
position:absolute;
visibility: visible;
left:50%;top:0px;
width: 780px;
margin-left:-390px;
height: 200px;
}




/*YOUR SIDEBAR*/
#sidebar{
position:absolute;
top:120px;
left: 50%;
margin-left: 146px;
width: 224px;
height: auto;
visibility: visible;
z-index:2;
font-size:8pt;
text-align:justify;
}
#sidebar img{
display:inline;
}



/*BACKGROUND IMAGE*/
body {
background-color:#66CC9A;
background-image: url(http://pics.livejournal.com/carriep63/pic/0000p1xp);
background-attachment:fixed;
background-repeat: repeat-y;
background-position: top center;
}


/*YOUR ENTRIES*/
table, tr, td, .shadowed {
background: transparent;
}

table {
left:50%;
width: 510px;
margin-left:-240px;
}

table table {
width: 100%;
margin:0;
}
table table table {
width: auto;
}


/*JUSTIFIES TEXT*/
.entrybox td{
position:relative;
text-align: justify;
}
.entrybox td.index, .entrybox td.comments{
text-align: right;
}


/*LINKS*/
a{
color: #ffffff;
}
a:hover{
color: #66CC9A;
}

-->
</style>
<=GLOBAL_HEAD


LASTN_WEBSITE<=

<!--YOUR SIDEBAR STUFF HERE-->
<div id="sidebar">
The text, links, and pictures you want in your sidebar.<br />
--------------------
<br />
I am going to put an image in this sidebar. Usually when you hide
your icon, you have to put a visibility code in every image you use.
That is not necessary with this layout. We have not hidden our icon,
we have DESTROYED it! It's gone. Not hiding. I just put a simple
code in the HEAD overrides that will allow all of the sidebar pictures
to show without extra code. Look:<br /><br />
<center>
<img src="http://pics.livejournal.com/carriep63/pic/0000rec6">
</center>
</div>

<!--This fixes a bug in Internet Explorer-->
<div>&nbsp;</div>


<div id="x">
<!--HEADER IMAGE-->
<img src="http://pics.livejournal.com/carriep63/pic/0000qkxc" style="display:inline;">
</div>

<=LASTN_WEBSITE

Positioning codes explained To move your content to the right and left, change your margin-left number!

You may notice that in this tutorial, I have positioned everything with the margin-left override and no margin-right overrides. Using this method will keep the content of your page in the same spot regardless of the screen resolution. When you are using this method, you may use either positive or negative numbers.
  • Enter the height of your image where it says height.
  • You MUST define a width or this will NOT work.
  • A positive margin-left will push your content to the right.
  • A negative margin-left will push your content to the left.
  • A negative margin-left that is exactly half of the width will center the content
  • Don't change the left:50% to anything else!

More on centering... Notice the header image positioning. It has a width of 780px and the margin-left is negative 390px. 390 is exactly half of 780, so that puts the header in the center. All of the position codes have the left:50% override in them. Do not change that portion of the code.


INTERNET EXPLORER
Is your header one pixel off in Internet Explorer?grumble....stupid IE (get firefox!) This usually only occurs if your header image is an "odd" number of pixels like 537px. If it's an even number (538px) then this usually doesn't occur.


Second Sidebar

Want to add another sidebar? Just copy the #sidebar code and name it something else. We'll name it sidebartwo:

The GLOBAL_HEAD codes:(you will have to change the margin-left to suit your needs)
#sidebartwo{
position:absolute;
top:120px;
left: 50%;
margin-left: 145px;
width: 225px;
height: auto;
visibility: visible;
z-index:2;
font-size:8pt;
text-align:justify;
}
#sidebartwo img{
display:inline;
}

The LASTN_WEBSITE codes:

<div id="sidebartwo">
The text, links, and pictures you want in your sidebar.<br />
</div>



Page 1 of 4
<<[1] [2] [3] [4] >>

(Post a new comment)


[info]008deux
2005-08-19 05:10 am UTC (link)
Awesome. The centering is especially nice. All hail the majesty of a really nicely coded sidebar layout :)

(Reply to this)


[info]ladymiry
2005-08-19 05:18 am UTC (link)
Wowza. Thanks bunches. That's really awesome, very helpful as well!

(Reply to this)


[info]dmodegirl
2005-08-19 05:33 am UTC (link)
Thanks you lovely coding goddess!

I'll have to play with this after my surgery tomorrow. My sister has a free account and I've been meaning to do something for her since she's utterly clueless to this stuff.

(Reply to this)


[info]papercutbruises
2005-08-19 05:51 am UTC (link)
What a great tutorial! I think I am going to give it a try making my own layout now. Thanks!

(Reply to this)


[info]summer_kisz
2005-08-19 05:52 am UTC (link)
*saves to memories* thanx! i needed that!

(Reply to this)


[info]fuyou
2005-08-19 09:43 am UTC (link)
That's a wonderful tutorial, and easy to understand as well. I'll be using this method for my own layout now. =D

(Reply to this)


[info]x_katrina
2005-08-19 09:46 am UTC (link)
this is for generator, right?

(Reply to this) (Thread)


[info]carriep63
2005-08-19 03:17 pm UTC (link)
Yes.

(Reply to this) (Parent)

(no subject) - [info]madness_of_mary, 2006-02-22 04:12 am UTC

[info]appleweiland
2005-08-19 10:01 am UTC (link)
I'm an ass.

I don't know if anyone else has this issue, but the repeating background is off by, like, 1 or 2 px in IE/800x600. I'm sure people that know how to use the code in the first place will be able to fix it, though, which is what I plan to do if I ever use this. Just thought I'd let you know.

(Reply to this) (Thread)


[info]eskeemo
2005-08-19 10:48 am UTC (link)
I am having the same problem with my community layout in IE but with 1024x768 as well.
But this was before this tutorial came out as I was just going by what [info]teneraestnox was saying in her comments in [info]lls_
Still doesn't work. Meh.

(Reply to this) (Parent)(Thread)

(no subject) - [info]carriep63, 2005-08-19 03:28 pm UTC
(no subject) - [info]eskeemo, 2005-08-19 04:55 pm UTC
(no subject) - [info]eskeemo, 2005-08-19 05:15 pm UTC
(no subject) - [info]carriep63, 2005-08-19 03:19 pm UTC
(no subject) - [info]puckle_layouts, 2005-11-03 01:28 am UTC

[info]stormysanctuary
2005-08-19 11:37 am UTC (link)
You did an awesome job. I love your turitorals. Thanks for keeping up with what everyone likes and wants. I do have to say this is my favorite community.

(Reply to this)


[info]____heavyheartx
2005-08-19 12:19 pm UTC (link)
ahh lovely..i actually get this now! lol saving in memories

(Reply to this)


[info]adidaschica2323
2005-08-19 05:02 pm UTC (link)
memorified for later use! awesome!!!

(Reply to this)


[info]blueskies14
2005-08-19 06:47 pm UTC (link)
I still can't figure out how to make multiple boxes for the sidebar =(.

(Reply to this)


[info]volonte
2005-08-20 01:49 am UTC (link)
Can you use this with a scrolling entry box and rollovers? :D

(Reply to this) (Thread)


[info]carriep63
2005-08-20 01:57 am UTC (link)
I believe the scrolling entry box/rollover tutorial already has similar codes.

(Reply to this) (Parent)


[info]avril_charday
2005-08-20 08:54 am UTC (link)
this is so awesome!just the kind of thing i was looking for!thanks a bunch for making this tutorial!

(Reply to this)

(Reply from suspended user)

[info]_jamocajellyx
2005-08-21 10:01 pm UTC (link)
Lovely tutorial, just one thing- I can't get my header centered.. I'm trying to make a layout for a friend and here's what it looks like right now> http://test.livejournal.org/users/serendipityxo/

Any ideas on how to fix it?

(Reply to this)

Probably a stupid question ...
[info]vaguelyclear
2005-08-27 11:16 am UTC (link)
Can you move the entries down the page? I've been testing the code out and I can't seem to be able to move the entries down without having to move the header. I don't know if I've missed something or not but I was just wondering if it was possible ...?

Thanks :)

(Reply to this) (Thread)

Re: Probably a stupid question ...
[info]carriep63
2005-08-27 12:43 pm UTC (link)
Move the entries down just like you would on any other layout.

body{
margin-top:300px;
}

(Reply to this) (Parent)(Thread)

Re: Probably a stupid question ... - [info]nikkitheshort, 2005-12-12 11:49 pm UTC
Re: Probably a stupid question ... - [info]bashful_dreams, 2006-03-08 11:11 pm UTC

[info]maureeni
2005-08-29 02:27 am UTC (link)
how would one go about adding a second sidebar using this tutorial?

(Reply to this)


[info]cassiesporaa
2005-09-03 03:32 am UTC (link)
I just want a side bar,
&I tried to use the code for just the sidebar;
it didn't work.
It messed up my entire page.

&I've tried other sidebar tutorials,
&they didn't seem to work either.

(Reply to this) (Thread)


[info]olivetti250
2006-05-15 07:56 pm UTC (link)
You need to have a "website" (literally, just a bunch of text, gibberish or a fave site of yours) in your "userinfo." That'll fix everything!

(Reply to this) (Parent)


[info]slutdujour
2005-09-04 09:18 am UTC (link)
How would I combine the image map tutorial into this code?

(Reply to this)


[info]butterflysteel
2005-10-01 07:03 pm UTC (link)
This is so utterly awesome. Just what I've been looking for, thank you!

(Reply to this)


[info]aimberyo
2005-10-02 12:52 am UTC (link)
Thanks so much...I am using this!!! But I think I messed up somewhere. Everything is centered until I resize the screen then the header image is off. Is there away to fix this or did I miss it in the code somewhere?

(Reply to this) (Thread)


[info]carriep63
2005-10-02 02:25 am UTC (link)
You have to refresh it if you resize.

(Reply to this) (Parent)


[info]_6785_
2005-10-09 03:05 am UTC (link)
I'm using this as the base for a different layout with sidebar
but i was wondering which part of the code is the one that allows all images to be seen without a visibility code?
or how i could plug a visibilty code with my picture in the sidebar?

[i'm crediting you guys for help, but this is just my tester journal]
[info]drrosensteinmd
that's the normal one.

(Reply to this)


[info]feelinpeachy
2005-10-11 06:41 pm UTC (link)
Hey, I'm trying to use this one right now on a different journal, but the entries being centered is really bothering me/messing up the layout. Is there any way to like turn it off, or change it? I tried using a negative 'margin-left', but it hasn't moved and even if it did, if the screen is expanded, it moves from where I put it.

I don't even know if that made sense.. haha. But thank you for your help in advance, the coding is great.

(Reply to this)


[info]obisgirl
2005-10-13 09:16 pm UTC (link)
Is there a way I can move my journal entries down, so it's not on top of my header? I've tried and it doesn't seem to be moving too much.

(Reply to this) (Thread)


[info]feelinpeachy
2005-10-14 03:42 am UTC (link)
How'd you get your entries to stick like that?

(Reply to this) (Parent)(Thread)

(no subject) - [info]obisgirl, 2005-10-14 01:02 pm UTC

Page 1 of 4
<<[1] [2] [3] [4] >>

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