Solved

Units of Length for Width and Height

Posted on 2008-10-26
5
574 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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 a countdown to HTA 12 99
Mobile apps - web/native or hybrid? 1 73
Send email using HTML and PHP in separate file 5 41
Validating Date 4 29
This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

726 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