Solved

Units of Length for Width and Height

Posted on 2008-10-26
5
565 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 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

19 Experts available now in Live!

Get 1:1 Help Now