Register Blogs FAQ Calendar Search Today's Posts Mark Forums Read

Computing and Networks For discussion of personal computing and home networking issues.

Reply
 
Thread Tools
Old 25-04-2007, 16:14   #1
iain
Forum Member
 
Join Date: Mar 2000
Location: UK
Services: Telewest, Telewest Blueyonder BB, Freeview
Posts: 53,185
CSS help

anyone know their CSS?

i'm playing around with a simple site, that originally looked like :

original

using messy tables, and have been trying to redo it just using CSS.

it's almost there in principle, and currently looks like :

css version

the thing that's bugging me is the missing 1px border around the main wrapper <div>.

The CSS layout looks like :
/* CSS Document */

#left {
background:#cccccc;
float:left;
width:187px;
border: 1px solid black;
margin-top:1px;
height:400px;
}
#main {
background:#ffffff;
float:left;
width:410px;
border: 1px solid black;
margin-top:1px;
padding-left:10px;
height:400px;
}
# h2, #main h3, #main p {
padding:0 0 10px 0;
}

#sidebar {
background:#666666;
float:right;
width:145px;
border: 1px solid black;
margin-top:1px;
height:400px;
}
#sidebar ul {
margin-bottom:0;
}
#sidebar h3, #sidebar p {
padding:0 0 0 0;
}

And the wrapper's styling is in a separate file :

html {
margin-top:30px;
padding:0;
background:#FFFFFF;
color:#000;
}
body {
min-width:760px;
background-color: #FFFFFF;
}
#wrapper {
margin:0 auto;
width:760px;
border: 1px solid black;
background-color:#FFFFFF;
}

any help or pointers greatly appreciated.

cheers,
Iain

Last edited by iain : 25-04-2007 at 16:22.
iain is offline   Reply With Quote
Most Popular on Digital Spy

Please sign in or register to remove this message.

Old 25-04-2007, 17:02   #2
pjb007
Forum Member
 
Join Date: May 2003
Location: Shropshire - (Tx: The Wrekin)
Services: Sky+, Sky Broadband Connect, Sky Talk. OS: XP Pro, Vista Home Premium
Posts: 9,936
Try changeing any
border: 1px solid black;

to
border: 0px;
pjb007 is offline   Reply With Quote
Old 25-04-2007, 17:21   #3
iain
Forum Member
 
Join Date: Mar 2000
Location: UK
Services: Telewest, Telewest Blueyonder BB, Freeview
Posts: 53,185
thing is i want the 1px border around the wrapper.

it actually looks as i would expect in IE (6) now, ie with the three content divs (+header) sitting nicely in the wrapper div :

link

but not in safari or firefox. if you can look in either as well as IE you'll see what i mean.

the CSS now looks like :

#wrapper {
margin:0 auto;
width:760px;
border: 1px solid black;
background-color:#FFFFFF;
}
#left {
background:#cccccc;
float:left;
width:187px;
border: 1px solid black;
margin:1px;
height:400px;
}
#main {
background:#ffffff;
float:left;
width:410px;
border: 1px solid black;
margin-top:1px;
padding-left:5px;
padding-right:5px;
height:385px;
}
# h2, #main h3, #main p {
padding:0 0 10px 0;
}
#sidebar {
background:#666666;
float:right;
width:133px;
border: 1px solid black;
margin:1px;
height:400px;
}
#sidebar ul {
margin-bottom:0;
}
#sidebar h3, #sidebar p {
padding:0 0 0 0;
}
html {
margin-top:30px;
padding:0;
background:#FFFFFF;
color:#000;
}
body {
min-width:760px;
background-color: #FFFFFF;
}

Cheers,
Iain
iain is offline   Reply With Quote
Old 25-04-2007, 17:29   #4
click2366
Forum Member
 
Join Date: Jun 2006
Location: Kent, UK
Services: o2 home/mobile Broadband, Freeview, iPhone 16GB 3G, Vaio Laptop
Posts: 219
is it a case that the border seems to stay at the top where #wrapper starts? if so, put <div style="clear:both"></div> at the bottom before the end of the </div> of #wrapper

I tend to do this because otherwise the border just stays at the top of the page (looking like a horizontol 2px line (1px x2 etc)

try that and let me know if it works
click2366 is offline   Reply With Quote
Old 25-04-2007, 19:25   #5
alias alias
Forum Member
 
Join Date: May 2006
Location: Yorkshire
Services: Firefox PSN ♂
Posts: 2,757
Blog Entries: 1
firefox add on firebug may be of help to you

edit
and i think changing the width fixes it

#wrapper {
background-color:#FFFFFF;
border:1px solid black;
margin:0pt auto;
width:758px;

Last edited by alias alias : 25-04-2007 at 19:50.
alias alias is offline   Reply With Quote
Old 25-04-2007, 19:41   #6
pjb007
Forum Member
 
Join Date: May 2003
Location: Shropshire - (Tx: The Wrekin)
Services: Sky+, Sky Broadband Connect, Sky Talk. OS: XP Pro, Vista Home Premium
Posts: 9,936
Quote:
Originally Posted by alias alias
firefox add on firebug may be of help to you
Also Web Developer I used that to edit the CSS for my reply in #2 and preview the change within the browser
https://addons.mozilla.org/en-US/firefox/addon/60
pjb007 is offline   Reply With Quote
Old 25-04-2007, 19:53   #7
iain
Forum Member
 
Join Date: Mar 2000
Location: UK
Services: Telewest, Telewest Blueyonder BB, Freeview
Posts: 53,185
Quote:
Originally Posted by click2366
is it a case that the border seems to stay at the top where #wrapper starts? if so, put <div style="clear:both"></div> at the bottom before the end of the </div> of #wrapper

I tend to do this because otherwise the border just stays at the top of the page (looking like a horizontol 2px line (1px x2 etc)

try that and let me know if it works
yes! thank you. that clear:both has caught me out before, but i took it to mean that one <div> was clearing any <div>s above it.

so it didn't occur to me here as the <div>s in question sit within the main wrapper.

what does the both actually refer to?

i'll also check out that firebug, cheers.

Iain
iain is offline   Reply With Quote
Reply




Thread Tools

Forum Jump


All times are GMT. The time now is 22:32.


Entertainment: Showbiz | Music | Television | Movies | Soaps | Cult | US TV | Gaming | Gay Spy
Reality TV: Big Brother | Strictly | X Factor | American Idol
Media: Broadcasting | Digital TV | Tech Reviews

Elle | Red | Red Direct | Psychologies | SugarScape | All About Soap | Inside Soap

Copyright © 1999-2010 Digital Spy Limited. All Rights Reserved.
"Digital Spy" is the Registered Trade Mark of Digital Spy Limited.
Privacy Policy   Terms and Conditions   Advertise on Digital Spy

Forums Directory