Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / November 2006



Tip: Looking for answers? Try searching our database.

body property and <div>

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jasper - 18 Nov 2006 12:16 GMT
hi everybody,

i'm just stepping in the world called css and can't seem to solve this
little problem:

i wanted a nice red lining in my otherwise green website, so wrote this

in my external css:

body {
background-color: green;
border-width: 0 0 0 100px;
border-style: solid;
border-color: red;
}

this seems to work nice, but suddenly a <div> containing links to other

parts of my site (the navbox) disappears beneath to border (check out
dejaspersmit.awardspace.com/Home to see an example of my navbox. the
different colors aren't impemented there yet)!

my navbox is defined as follow:

div#navbox {
position:absolute;
margin-left:-250px;
margin-top:20px;
}

(so margin-left is negative so that it gets to the right position)
if you need more info, let me know...

what can i do about it?? i tried the z-index but that doesn't help...

thx for any ideas!
Jasper
dorayme - 18 Nov 2006 23:10 GMT
In article
<1163852175.692279.221470@f16g2000cwb.googlegroups.com>,

> hi everybody,
>
> i'm just stepping in the world called css and can't seem to solve this
> little problem:

Before leaving the html world, put a doctype in and clean up the
html (there are stray things there)

Don't use stuff like this:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&

nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp


> i wanted a nice red lining in my otherwise green website, so wrote this

I guess you could do this red strip this way. But some of your
css is too complicated and confused for this design. Stay away
from any position: anything for a while.

font-size: 100%; in body, no need for setting it in children
unless you need to...

Don't use font-size: 20px; Use a font size as a percentage of the
body text. Perhaps in this case, font-size:140%;

You keep having headings that are main headings, <h1>. There is
either one main heading (or understood one) and a number of lower
order headings.

Why not try this: cut out as many things in the css as you can
without affecting the appearance to its detriment.

Don't use align="center" in the <p>. Use the css for a class for
it. That is what the css is for.

I will stop now.

Try:

http://www.htmldog.com/guides/htmlbeginner/

Signature

dorayme

Jasper - 29 Nov 2006 06:49 GMT
hi again,

thx for your reply, i really apreciate it!

i got a doctype now (only for the main document, i will do the same for
the other ones later on). i decided on 'strict' cause it's just a new
page (don't need transition) and i want to be as 'strict' as possible.
the w3c validator now officially approves that page :)

sorry about the &nbsp; and all. when i first generated the page i was
using ms frontpage and i guess frontpage put all those annoying symbols
there. i got rid of them :)

the font-size as a % is a good tip.

> Stay away from any position: anything for a while.

why should i??

> in body, no need for setting it in children unless you need to...

i'm not sure i understand what you mean by this...

i'm only using 1 kind of header now cos so far thats all i needed. i
can see your point though...

i think my css is fairly efficient...

> Don't use align="center" in the <p>. Use the css for a class for it. That is what the css > is for.

you're completely right...i changed it to a css class...

any more comments?

more on-topic: whats your idea for adding the left 'line' if you don't
want to do it by changing the padding of the body?

well, thx again,
Jasper

> In article
> <1163852175.692279.221470@f16g2000cwb.googlegroups.com>,
[quoted text clipped - 41 lines]
>
> http://www.htmldog.com/guides/htmlbeginner/
dorayme - 29 Nov 2006 21:34 GMT
In article
<1164782973.253091.272960@l12g2000cwl.googlegroups.com>,

> thx for your reply, i really apreciate it!

Best not to top post (And I can't be bothered fixing it here)

> > Stay away from any position: anything for a while.
>
> why should i??

I guess I said that because I did not feel you understood
positioning that well. It can be a bit tricky and best to keep
things simple till you need not to be simple.

> > in body, no need for setting it in children unless you need to...
>
> i'm not sure i understand what you mean by this...

Just that if you set font-size: 90% in a classed div, for
example, and inside the div is another differently classed div or
whatever, you don't need to set font-size again for this
contained div. It assumes this from the parent.

> i'm only using 1 kind of header now cos so far thats all i needed. i
> can see your point though...

Some people would be saying that there cannot be a whole lot of
<h1>s on a page because there cannot be more than one _main_
heading. It is a tricky issue (I think there can be under certain
conditions). But there can certainly be many sub headings.

> any more comments?
>
> more on-topic: whats your idea for adding the left 'line' if you don't
> want to do it by changing the padding of the body?

Sorry Jasper, have forgotten the issue? You are not helping top
posting and not including relevant bits... If you want a left
line to look like a separator just use a border, a left or right
border depending on your needs.

> > I will stop now.
> >
> > Try:
> >
> > http://www.htmldog.com/guides/htmlbeginner/

Signature

dorayme

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.