• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Do divs have sizes?

Advocate ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

I'm trying to figure how how divs differ from tables. Do dives have sizes?

Views

237

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 23, 2017 Dec 23, 2017

AnotherMe  wrote

Do dives have sizes?

Sure they do.  In simplest terms, a division is a box.   Refer to the CSS Box Model.

A division's size is its width + margins + padding + borders.  Height is determined by content inside the box.  Thus there's no need to set explicit height values on divs that contain content.

In responsive layouts, we typically give divisions a % width instead of fixed pixels.  But there are times when you might need to use other CSS Units .

Votes

Translate

Translate
Community Expert ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

A DIV is a block level element just like

<address><article><aside><blockquote><canvas><dd><div><dl><dt><fieldset><figcaption><figure><footer><form><h1>-<h6><header><hr><li><main><nav><noscript><ol><output><p><pre><section><table><tfoot><ul><video>

A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).

This behaviour can be changed by using style rules (CSS).

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 23, 2017 Dec 23, 2017

Copy link to clipboard

Copied

LATEST

AnotherMe  wrote

Do dives have sizes?

Sure they do.  In simplest terms, a division is a box.   Refer to the CSS Box Model.

A division's size is its width + margins + padding + borders.  Height is determined by content inside the box.  Thus there's no need to set explicit height values on divs that contain content.

In responsive layouts, we typically give divisions a % width instead of fixed pixels.  But there are times when you might need to use other CSS Units .

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines