Highlighted

Do divs have sizes?

Enthusiast ,
Dec 22, 2017

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Nancy OShea | Adobe Community Professional

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 .

Views

152

Likes

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

Do divs have sizes?

Enthusiast ,
Dec 22, 2017

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Nancy OShea | Adobe Community Professional

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 .

Views

153

Likes

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
Dec 22, 2017 0
Adobe Community Professional ,
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).


Ben

Likes

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
Reply
Loading...
Dec 22, 2017 1
Adobe Community Professional ,
Dec 23, 2017

Copy link to clipboard

Copied

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, ACP
Alt-Web Design & Publishing

Likes

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
Reply
Loading...
Dec 23, 2017 1