[Solved]tricky layout (help with css)

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

[Solved]tricky layout (help with css)

Post by Recon »

Hi,

My basic background layout is this:
"http://w...

Cloud background with jquery full screen supersizer.
How can I get that green line start from the left side of the screen and cut it to content. Green line must be stretchable, so it will be on the left side every browser's resolutions.

Here is beginnig of my work.
"http://w...

Best
-R
Last edited by Recon on Thu Jun 28, 2012 7:29 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: tricky layout (help with css)

Post by Dr.CSS »

You will have to break the line div out of the rest of the divs then use a % to stop it on the right...
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

Re: tricky layout (help with css)

Post by Recon »

If using margin-right: % it will not stay in correct place when zooming in or out.

-R
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

Re: tricky layout (help with css)

Post by Recon »

Tips for this, please.

-R
Zoorlat

Re: tricky layout (help with css)

Post by Zoorlat »

First of all, to ensure liquid layout ("zooming in and out") use em instead of px when you specify the size of your objects.

To get the green line in place, I'd place the div for this line inside the middle-div. This way you have a common right side edge to relate to. Eg:

Code: Select all

<div id="realBody">
   <div id="top"></div>
   <div id="middle">
	<div id="line"></div>
	<div id="content"><p>Content</p></div>
   </div>
   <div id="bottom"></div>
</div>
Then you can specify the right-margin of the line-div to be the same (in em's) as the black border. Give the left-margin a very high negative and it will expand to the left edge of the window.

Eg:

Code: Select all

#line{
background: url(http://whm10.louhi.net/~vvpakki2/uploads/css/greenline.png) repeat-x center center;
height:7em;
margin-right:10.5em;
margin-left:-100em;
}
Assuming you have modified your other margins, paddings and heights to em, this gives the result you asked for.

Good luck!
Z
Recon
Forum Members
Forum Members
Posts: 200
Joined: Sat Oct 09, 2010 10:23 am

Re: tricky layout (help with css)

Post by Recon »

Thank you Zoorlat,

seems that it works very well... also on different browsers.
Thank you.

-R
Post Reply

Return to “Layout and Design (CSS & HTML)”