CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

Width and Height in CSS

Width and Height

 

 

CSS width and height properties allow users to change or customize the width and height of the given element.

 

Properties Included Are:-

 

  • width
  • height
  • min-width
  • min-height
  • max-width
  • max-height

 

For your Information:-

 

min-width, max-width, min-height, and max-height are the properties used with media screens to make the website responsive.

 

Syntax:-

 

Its syntax is:-

< style >

element {

width: auto| value| initial| inherit;

height: auto| length| initial| inherit;

}

< /style >

 

Further Explanation:-

 

Value Description
auto The browser calculates the height and width.
length Defines the width and height in px, cm, etc.
% Defines the width and height in percent of the containing block
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Code Explanation

All Tutorials related to CSS Advance

All Sections related to CSS