CSS Articles

Page 73 of 130

Setting Margins for Individual Sides using CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 404 Views

CSS allows us to control the space around individual sides of an element using specific margin properties. The CSS margin property is a shorthand for the following properties: margin-top, margin-right, margin-bottom and margin-left. Syntax selector { margin-top: value; margin-right: value; margin-bottom: value; margin-left: value; } Possible Values Value Description ...

Read More

Universal Selector in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 2K+ Views

The CSS * selector is a universal selector which is used to select all elements of the HTML DOM. If you want to set a similar style for the entire document, then use the Universal selector. Syntax * { /* declarations */ } Possible Values The universal selector accepts any valid CSS properties as values. Common use cases include − PropertyDescription margin, paddingReset spacing for all elements box-sizingSet box model behavior for all elements font-familyApply consistent typography Example 1: Reset Margins and Padding To set the ...

Read More

Cross Browser Solution for Image Marker in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 221 Views

In order to display an image marker properly in all browsers, a cross-browser solution is required. The text alignment after the image marker is sometimes distorted. To achieve a uniform output, we specify the image to be used as a marker as background and align it accordingly. Syntax ul { list-style-type: none; } ul li { background-image: url("image-path"); background-repeat: no-repeat; background-position: x-position y-position; padding-left: value; } Example 1: Basic Image Markers The following example ...

Read More

Changing the Position of List Markers in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 6K+ Views

The CSS list-style-position property is used to set the marker position of list items. The default value for this property is outside which sets the marker outside the list item. It is having the following values − inside − The bullet points are positioned inside the list item outside − Default. The bullet points are positioned outside the list item Syntax selector { list-style-position: value; } Possible Values ValueDescription insideThe marker is inside the list item text outsideDefault. The marker is outside the list item text ...

Read More

CSS Background Properties

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 2K+ Views

CSS background properties help us style the background of elements. The CSS background property is a shorthand for specifying the background of an element. background-color, background-image, background-repeat, background-position, background-clip, background-size, background-origin and background-attachment together comprise the CSS background properties. Syntax selector { background: color image repeat position / size attachment origin clip; } Background Properties PropertyDescription background-colorSets the background color of an element background-imageSets background image(s) for an element background-repeatControls how background images repeat background-positionSets the position of background images background-sizeSpecifies the size of background images background-attachmentControls scrolling behavior ...

Read More

The border-width Property in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 118 Views

The CSS border-width property is used to specify the width of an element's border. You can set the width for all sides at once or control individual sides using specific properties. Individual border width properties include − border-top-width border-right-width border-bottom-width border-left-width Syntax selector { border-width: value; } Possible Values ValueDescription thinA thin border (typically 1px) mediumA medium border (typically 3px) thickA thick border (typically 5px) lengthA specific width in px, em, rem, etc. Example: Thick Border The following example demonstrates a thick ...

Read More

How to create and style borders using CSS?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 129 Views

We can define borders for an element and style them using CSS. The CSS border property is used to define the border properties for an element. It is a shorthand for border-width, border-style and border-color. Furthermore, images can be specified as a border. Syntax selector { border: width style color; } Possible Values PropertyDescriptionValues border-widthDefines the thickness of the borderthin, medium, thick, or length (px, em, rem) border-styleDefines the style of the bordersolid, dashed, dotted, double, groove, ridge, inset, outset, none border-colorDefines the color of the bordercolor name, hex, ...

Read More

The padding shorthand Property in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 353 Views

The padding property in CSS is a shorthand property that allows you to set the inner spacing for all four sides of an element in a single declaration. It controls the space between an element's content and its border. Syntax selector { padding: value; } Possible Values Number of ValuesDescriptionOrder 1 valueApplied to all four sidestop, right, bottom, left 2 valuesFirst = top/bottom, Second = left/rightvertical, horizontal 3 valuesFirst = top, Second = left/right, Third = bottomtop, horizontal, bottom 4 valuesClockwise from toptop, right, bottom, left Example ...

Read More

Relative Length Units in CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

Relative length units in CSS are used to specify a length relative to another length property. These units provide flexibility and responsiveness in web design by scaling based on context rather than fixed values. Syntax selector { property: value + unit; } Types of Relative Length Units Unit Description em Relative to the font-size of the element (4em = 4 times current font size) ex Relative to the x-height of the current font ch Relative to width of the "0" character ...

Read More

Setting Column Rules in CSS3

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 238 Views

The CSS column-rule property is used to create visual separators between columns in a multi-column layout. It allows you to set the width, style, and color of the rule that appears between columns. Syntax /* Shorthand property */ column-rule: width style color; /* Individual properties */ column-rule-width: value; column-rule-style: value; column-rule-color: value; Possible Values PropertyValuesDescription column-rule-widththin | medium | thick | lengthSets the width of the column rule column-rule-stylenone | solid | dotted | dashed | doubleSets the style of the column rule column-rule-colorcolor valuesSets the color of the column rule ...

Read More
Showing 721–730 of 1,299 articles
« Prev 1 71 72 73 74 75 130 Next »
Advertisements