Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross-Browser CSS Issues 3

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
This does not show well in Firefox... what am I doing wrong? shows fine in IE

Code:
<div style="height:100%; width:100%; text-align:center; " >
	<div style="height:405; width:817; background-image:url('images/splash.jpg');  text-align:left; ">
		<span style="margin-top:65pt; margin-left:5pt;height:40; width:425;  text-align:left; " class="contentw">
		--text--	
		</span>
	</div>
</div>

[conehead]
 
Jeff is correct, firefox will not recognize values for height and width (as well as many other properties) unless the units is specified, IE defaults to pixels. Put px after 40 and 425 and it'll work fine.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Thanks for catching that, but the issues seem to be with the text-align and margin-left and margin-top....

[conehead]
 
Margin-top (or bottom) won't work on non-IE browsers when you are styling a span (that isn't styled to be display:block). Using margin-left is problematic with spans in the same way.

Try setting the span to display:block or use left (instead of margin-left).

Again... just a thought... since I can't test it here atm.
Jeff


[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Span is an inline element and as such cannot have a number of attributes that you are applying applied. Namely width, height, margin-top and text-align. If your class defines this span as a block level element, then it is ok, otherwise your code will (and should) fail. Question arises why use the span element, when div would do just fine.
 
thanks - I changed it to div and changed margin-top to padding-top and everything seems to be working except for the text-align: center ... I tried float: center but still no dice...

[conehead]
 
You have text-align:left on the <span> in your original post. If you want it centered you could use: {margin-left:auto; margin-right:auto} and that should center it.

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top