Front End Technology Articles

Page 509 of 652

The margin Shorthand Property in CSS

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

The CSS margin shorthand property is used to define the margin area around an element. It sets values in clockwise direction: margin-top, margin-right, margin-bottom, and margin-left. Syntax selector { margin: value; } The margin property accepts 1 to 4 values − Number of ValuesResult 1 valueAll four sides have the same margin 2 valuesTop/bottom get first value, left/right get second value 3 valuesTop gets first, left/right get second, bottom gets third 4 valuesTop, right, bottom, left (clockwise) Example 1: Single Value The following example applies 30px ...

Read More

Adding Borders to Tables in CSS

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

Adding borders to tables in CSS allows you to create visually appealing and well-structured table layouts. You can apply borders to the entire table or customize individual sides with different styles, widths, and colors. Syntax table { border: width style color; } /* Individual border properties */ table { border-top: width style color; border-right: width style color; border-bottom: width style color; border-left: width style color; } Basic Table Border The following example demonstrates ...

Read More

Setting Margins for Individual Sides using CSS

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 418 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 224 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 123 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 139 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 373 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
Showing 5081–5090 of 6,519 articles
« Prev 1 507 508 509 510 511 652 Next »
Advertisements