I am having 2 divs , and i don't like how they allign , how i can make <div> Hello </div> <div> WORLD </div> , how i can make this 2 words to stay one to each other?!
As far as I know, "inherit" is not an allowed value of "float". Is this a CSS3 thing? Float can only be left, right, and none (none does prevent inheritance, but inheritance cannot be set with the word "inherit" as it's automatic). I'd be curious to see what the above looks like (I'm too lazy to build it myself). I would think the that clear: left in div one would prevent div2 from riding up alongside.
Uhm... avoid the headache of floats and set both to display:inline; (assuming you don't need to set width or height on them) or display:inline-block; (and it's -moz equivalents if you do need to set dimensions)??? Though at that point the question becomes why are you using DIV and not SPAN? (It's wierd - I've been seeing a LOT of code lately of people reversing the two)
div {display: inline;} Code (markup): this code makes divs into inline elements instead of block elements
Not that the inherit in that particular example would DO anything... since it's not nested in the first one, all it's going to set is float:none; - since that's the default behavior for body... Which is why I suggested other angles of attack.
My guide/cheat sheet simply doesn't mention it... which makes me trust it (the guide) less. I've never used "inherit" for anything so if it makes a difference somewhere with some code I should learn it. When would float: inherit be used? I assumed in the above example that he was trying to undo the clear for some reason (why there's a clear right after a float when you WANT the following div to ride up, I dunno...)