Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Units of Length for Width and Height

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding bootstrap to only Content page and NOT master page 1 49
Pure CSS popout image menu - want the most beautiful style. 7 52
Index on a Table 6 25
Hide Table in merge 3 31
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

840 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