School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,144 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,733 people online right now. Registration is fast and FREE... Join Now!




CSS Liquid Layout

 

CSS Liquid Layout

AGRAC393

24 Oct, 2009 - 05:32 PM
Post #1

D.I.C Head
**

Joined: 13 May, 2009
Posts: 234



Thanked: 2 times
My Contributions
Ok, so in one of my last posts, I ask how to make my website look the same on all screen resloutions. Someone suggested liquid layouts. So, I did some research and I found this:
CODE

{
    margin: 0;
    padding: 0;
}

body
{
    background: #FFF;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2px;
}

h2
{
    padding: 5px 0 5px 0;
    margin: 0 0 10px 0;
}

p
{
    margin: 0 0 10px 0;
}

ul
{
    padding: 5px 0 5px 20px;
}
    
li
{
    padding: 3px 0 3px 0;
}
    
#wrapper, #content-wrapper
{
    float: left;
    width: 100%;
}

#header
{
    height: 60px;
    padding: 15px 0 5px 0;
    border-bottom: 1px solid #ccc;
    background: #FFFFDF;
}


#content
{
    margin: 0 15% 0 20%; /*Margins for content column. Should be “0 RightColumnWidth 0 LeftColumnWidth*/
}

#left
{
    float: left;
    width: 20%; /*Width of left column in percentage*/
    margin-left: -100%;
    background: #EEFFDF;
}

#left h2, #right h2
{
    border-bottom: 1px dotted #CCC;
}

#right
{
    float: right;
    width: 15%; /*Width of right column in pixels*/
    margin-left: -15%; /*Set margin to that of -(RightColumnWidth)*/
    background: #DFFDFF;
}

#footer
{
    clear: left;
    width: 100%;
    background: black;
    color: #FFF;
    text-align: center;
    padding: 4px 0;
}

#footer a
{
    color: #FFFF80;
}

.in
{
    margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
    margin-top: 0;
}

I got it from nowcss. It then occured to me that I don't know how to use the percentages. Are there any tuts around here for that? Also, when you use the supplied code, I doesn't look like the picture they say it shoud. Can someone take a look at the code and confirm it.

Thanks for anything,
Aaron

User is offlineProfile CardPM
+Quote Post


jwwicks

RE: CSS Liquid Layout

24 Oct, 2009 - 06:12 PM
Post #2

D.I.C Head
Group Icon

Joined: 31 Jul, 2008
Posts: 151



Thanked: 22 times
Dream Kudos: 250
My Contributions
Hello,

I'd suggest looking at meyers.com or a listapart or csszengarden.

Here's a great link to several working examples of liquid layouts:

http://matthewjamestaylor.com/blog/ultimat...nd-pixel-widths

Jw

PS - The code in the example on the nowcss site isn't the same as the downloadable version. Try downloading the zip on the site.

This post has been edited by jwwicks: 24 Oct, 2009 - 06:22 PM
User is offlineProfile CardPM
+Quote Post

AGRAC393

RE: CSS Liquid Layout

25 Oct, 2009 - 08:19 AM
Post #3

D.I.C Head
**

Joined: 13 May, 2009
Posts: 234



Thanked: 2 times
My Contributions
Thanks, Jw.

As far as the example, I didn't read all of the page crazy.gif Sorry.
Thanks for the links, I will put them to good use wink2.gif

~
Aaron
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:37PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month