Old 02-03-2008, 06:42   #1 (permalink)
Jay_bo
Registered User
 
Join Date: Nov 2007
Posts: 57
Text Allignment-CSS

#wrapper{
width: 757px;
height: -550px;
margin-left: auto;
margin-right: auto;
border: 1px solid #000000;
text-align: center;
background-color:#484745;
}

^^everything works in I.E but in firefox everything but the text-align:center.

Any ideas?
  Reply With Quote
Old 02-03-2008, 09:04   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
What about other properties - what's the rest of the CSS file.

Quote:
Originally Posted by Jay_bo
height: -550px;
wtf...
  Reply With Quote
Old 02-03-2008, 18:39   #3 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,609
You are going backwards. Code for firefox first and then adjust for I.E. It will make your life easier.
  Reply With Quote
Old 03-03-2008, 07:32   #4 (permalink)
Jay_bo
Registered User
 
Join Date: Nov 2007
Posts: 57
what would code be for firefox to make the text align?
  Reply With Quote
Old 03-03-2008, 07:40   #5 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,128
Quote:
Originally Posted by Jay_bo
what would code be for firefox to make the text align?
text-align:center;, which you already have.

I'd bet my left arm that there are other issue in your stylesheet that are causing browser inconsistencies. Why don't you post a link to the site so we can be helpful?
__________________
  Reply With Quote
Old 03-03-2008, 07:57   #6 (permalink)
Agricola
Senior Member
 
Agricola's Avatar
 
Join Date: May 2007
Location: England
Posts: 365
Jay-bo you have not taken any notice of pgo WTF comment, although you might think that is rude and sarcastic, that was my thoughts too when looking at that CSS you provided. You have height as a negative value which is illegal for the height property.

certainly providing a link to your site will help as we can all look at the complete css and html and spot any errors. You can check for errors yourself by running the CSS and HTML through validator as most of time pages not doing what they should are a result of errors in code, such as having height set as -500px.

The W3C CSS Validation Service
The W3C Markup Validation Service
  Reply With Quote
Old 03-03-2008, 15:30   #7 (permalink)
Jay_bo
Registered User
 
Join Date: Nov 2007
Posts: 57
body {
text-align:-moz-center;
#text-align:center;
font-family:Arial, Georgia, "Times New Roman", Times, serif;
color:white;
background-image:url(images/background.jpg);
}
#wrapper{
width: 757px;
height: 550px;
margin-left: auto;
margin-right: auto;
border: 1px solid #000000;
background-color:#484745;
}
#navigation{
display:inline;
width:auto;
height:auto;
}
#textbackg{
width:756px;
height:333px;
background-image:url(images/Template_19.jpg);
}
h2{
color:#A0A09E;
font-size:28px;
font-family:Arial, Georgia, "Times New Roman", Times, serif,;
}
#text{
color:#A0A09E;
width:90%;
}
a:link {
color:black;
}
a:visited {
color:black;
}
a:hover{
color:white;
}
a:focus{
color:pink;
}
a:active {
color:black;
}



my code, i have used -moz, which seems to have worked in firefox, is there any other errors i have made, and for some reason on one of them links, it says -moz is wrong when it has worked:S
  Reply With Quote
Old 03-03-2008, 16:03   #8 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Because anything "-moz" is invalid CSS.
  Reply With Quote
Old 03-03-2008, 17:02   #9 (permalink)
Jay_bo
Registered User
 
Join Date: Nov 2007
Posts: 57
So why does the text align work in my FireFox browser now, if it is invalid?
  Reply With Quote
Old 03-03-2008, 18:05   #10 (permalink)
Larixk
Senior Member
 
Larixk's Avatar
 
Join Date: Sep 2006
Location: Utrecht, Netherlands
Posts: 1,029
Send a message via MSN to Larixk
because browser developers don't care about w3c validation when implementing browser-specific features.

like, just because the blink tag works in netscape navigator doesn't mean it won't make tim berners lee cry.
__________________
  Reply With Quote
Old 11-03-2008, 15:33   #11 (permalink)
hyperzzzz
Registered User
 
Join Date: Mar 2008
Posts: 41
try removing it then adding it back in a different place, such as the top of your selectors.

Quote:

font-size:28px;


Arnt "em"s the standard now? or just becoming more and more used?
  Reply With Quote
Old 11-03-2008, 15:48   #12 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Quote:
Originally Posted by hyperzzzz
Arnt "em"s the standard now? or just becoming more and more used?
Most people use something other than pixels because IE can't resize text sized in pixels. Ems and percentages are most common.
  Reply With Quote
Old 12-03-2008, 05:36   #13 (permalink)
Jay_bo
Registered User
 
Join Date: Nov 2007
Posts: 57
Quote:
Originally Posted by pgo
Most people use something other than pixels because IE can't resize text sized in pixels. Ems and percentages are most common.

What are 'Ems'? i know how to do it as an % but how would you write 'Ems'.


About that '-moz' i can't see how you can't say it is invaild in css when it works anyway.
  Reply With Quote
Old 12-03-2008, 07:07   #14 (permalink)
woodss
Just another web monkey
 
woodss's Avatar
 
Join Date: Mar 2005
Location: Newcastle, UK
Posts: 215
Send a message via ICQ to woodss Send a message via MSN to woodss Send a message via Yahoo to woodss Send a message via Skype™ to woodss
It's invalid CSS because it is browser specific - it works in Firefox (MOZilla Firefox, get it? MOZ ... MOZ -moz) .. but IE/Opera/etc doesn't recognise -MOZZZZZ extensions to CSS

Also - ems...

Set your base font in the body tag, such as font-size: 1.0em which is the same as font-size: 100% ... you can use font-size: 1.2em which is 120% of the base font-size, etc.

p {
font-size: 955.2em;
color: #ff0000;
}

MOZ!
  Reply With Quote
Old 12-03-2008, 07:51   #15 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,609
1em is approximately the width of a small letter 'm' (get it: m's) at the current font size.

You write them 'em'
1em
2em
3em

Until you get a feel for how big they should be, just play with numbers.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8