Solved

Units of Length for Width and Height

Posted on 2008-10-26
5
568 Views
Last Modified: 2012-05-05
I'm working on a <td> element with width and height values with no units <td style="width: 7; height: 86;">.  No units are expressed with the 7 and 86, what are the units?
0
Comment
Question by:jdana
  • 2
  • 2
5 Comments
 
LVL 13

Assisted Solution

by:Xyptilon2
Xyptilon2 earned 350 total points
ID: 22806952
The default unit is px
0
 
LVL 11

Expert Comment

by:jgmontgo
ID: 22806957
As Xyptilon2 says the default unit is px, which is short for pixels
0
 

Author Comment

by:jdana
ID: 22807025
px, thank.  Is the same true for a <div> with height and width style properties?
0
 
LVL 13

Accepted Solution

by:
Xyptilon2 earned 350 total points
ID: 22807060
I looked it up in the official CSS specification.

Non 0 length attributes MUST have a unit defined. If they do not, it is up to the browser to determine what to do.

Since browsing deals with online media, it will try to approximate the length as much as possible and choose px.

If they (the units) are missing then some browsers follow the spec and ignore the invalid property/value combination, some browsers assume pixels for the reason above , and some browsers base their decision on if the browser is in quirks or
standards mode.
0
 

Author Closing Comment

by:jdana
ID: 31510085
thanks again
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can i create a customized Login page based on Wordpress ? 8 28
Centered Image 2 23
Not seen Link button 5 19
Target h5 of a div 3 10
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now