Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
width

3 Articles
{
,

}
Direct link to the article Exploring the Complexities of Width and Height in CSS
height layout width

Exploring the Complexities of Width and Height in CSS

The following article is co-authored by Uri Shaked and Michal Porag.

Let’s explore the complexities of how CSS computes the width and height dimensions of elements. This is based on countless late-night hours debugging and fiddling with lots of …

Avatar of Uri Shaked
Uri Shaked on Feb 5, 2021 (Updated on Mar 1, 2021)
Direct link to the article Measuring Image Widths in JavaScript (Carefully!)
images width

Measuring Image Widths in JavaScript (Carefully!)

Let’s say you want to find an <img /> on the page and find out how wide it is in JavaScript. Maybe you need to make some choices based on that width (or height, or both) You can definitely do …

Avatar of Chris Coyier
Chris Coyier on Mar 15, 2017
Direct link to the article width
layout width

width

The width property in CSS specifies the width of the element’s content area. This “content” area is the portion inside the padding, border, and margin of an element (the box model).

.wrap { 
  width: 80%;
}
…
Avatar of Sara Cope
Sara Cope on Sep 6, 2011 (Updated on Mar 3, 2021)

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top