• 0

CSS inline style different in all 3 browsers


Question

I need to create a class inline style. When I previewed it, all 3 browsers displayed it differently:

Here is the part of the code:

<div class="title">
	<p style="font-size:60pt; color:#990000; font-family:'Monotype Corsiva'; text-align:right; top:0px; right:10px ">The 78th Academy Awards</p>
</div>

And here is part of the stylesheet:

div.title{  
	position:absolute;
	background:white;
	top:40px;
	left:150px;
	right:0px;
	height:150px;
	}

Anybody can help me? I want the text to be aligned to the right and in the middle height wise. Basically opera got it right, but the others haven't. Thanks!

post-29046-1129132622_thumb.jpg

post-29046-1129132631_thumb.jpg

post-29046-1129132642_thumb.jpg

3 answers to this question

Recommended Posts

  • 0

1) Yes

2) You had positional styling in a block element. Unless the element has a width associated with it, its width is 100%, so "right: 10px" was ignored (and "top: 0px" is default as well)

As an extra, the div class can have the "right:0px" removed as you've got "left" in there. Positioning is done at a corner; top left, top right, bottom left, bottom right, making the opposite sides of the box mutually exclusive.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.