#header { background: #6a0202; width: 245px; height: 25px; float: left; color: #FFF; font-size: 30px; padding: 10px; position: relative; /* <-- add this and the next line */ left: -10px; /* <-- good practice to use the semi-colon on the last rule */ }
In this case it would be better to use ylex1's idea and switch from relative positioning to using a negative margin. You could then use a negative top margin on the main-bg div to bring it up over the header div
Also, don't fall into the trap of using divs for everything. Mark up the content as semantically as possible. The #header div should really be hx tags. And don't forget to validate - nav is not a valid element under xhtml
It may show validation however the markup is not correctly structured. To start off you need to rid the unnecessary div that I quickly saw after skimming the code and clear your floats.
Referring to what wolfcry has stated which is correct, you have HTML5 elements in an xHTML document. If you want to use HTML5, you need to change your doctype.
Ok I replaced the code above to how it looked before. I must have forgotten to edit a few things back such as the color of the text and the spacing between the content. However, in Firefox 4, I see the logo is aligned correctly.
No, I did not say that. I said it was pointless to use all those margins when you were not even clearing your floats. Everything looks good to me on Firefox 4.0 and Webkit browsers.
im new in css and testing something.
I will do that.
I have now
My header code:
#header { background: #6a0202; width: 245px; height: 25px; float: left;
color: #FFF; font-size:30px; padding: 10px }
PICTURE 1
I will do
Picture 2
Can anyone help me? :)
peace
Can you post your code? or a link to the site?
so its now left but it is possible to make the fiel behind the other one?
here is the test website..
http://xtreme-designs.de/testali/
now its valide too ^^
http://xtreme-designs.de/testali/
http://jigsaw.w3.org/css-validator/validator?uri=http://xtreme-designs.de/testali&profile=css3&usermedium=all&warning=1&vextwarning=
now im not the best css coder to see how to use another tags as divs :/
did you have sites to learn to use different tags for different situations
peace
why not negative margins? WC3 shows no problems :/
can u show an idea how it is right? :/
div id="main-trenner"
#main-trenner { background: #000; width: 730px; height: 15px }
to make the black a black area to show a separation between the slider an the content?
i dont know how to part it in another way?! :/
can u help me? :)
i have.. now its look like
http://xtreme-designs.de/testali/
the header must behind the contentslider
i mean like here
http://img69.imageshack.us/img69/7274/88258899.jpg
the background of the logo must a little bit left an a litte blit down like on the screenshoot
i show u what i see ond FF4 and what i want.
what i see now with your code
http://img840.imageshack.us/img840/5517/34478214.jpg
i need (my old code)
http://img219.imageshack.us/img219/807/41933563.jpg
if i use the code by wolfcry911
the logo shows right with IE8 and FF4.0
buts its not goot to use a negative margin right?
and u use FF4.1 ? is the beta out?
but big big thx for your help... i will try now, to fix the xhtml errors :)
http://validator.w3.org/check?verbose=1&uri=http://xtreme-designs.de/testali/
i have now 2 errors.. its by the code
if i remove the code "w3.org" show valid but i need the slider..
how can i make this better?
peace
i was confused :)
a big beginner mistake :)
thx.. i think now ist all ok :)