Found 1566 Articles for CSS

Creating a Slider / Carousel with CSS Flexbox (with infinite repeating items in loop)

AmitDiwan
Updated on 10-Feb-2021 13:23:13

2K+ Views

We can create an infinitely scrolling slider using CSS Flexbox with the help of JavaScript.ExampleThe following examples illustrate carousel using CSS. Live Demo                    img {             width: 100%;          }          .container {             max-width: 600px;             position: relative;             margin: 6% auto;          }          .prevbtn, .nextbtn {             position: absolute;   ... Read More

How to Create LEFT-RIGHT Alignment of Containers with CSS Flex?

AmitDiwan
Updated on 14-Dec-2023 17:36:36

896 Views

With flex, we can easily create left-right alignment of containers. The flexible items are displayed horizontally using the flex-direction property. The flexible items have a space between them since the justify-content is set to space-between. The following examples illustrate CSS flex property. Align with Flex Direction The div container is set to the flex value using the display property. The flex-direction allow the flex items to display horizontally − flex-direction: row; Example Let us see the example − #container { ... Read More

Vertical Text, with Horizontal Letters in CSS

AmitDiwan
Updated on 14-Dec-2023 11:17:03

969 Views

On a web page, you may need to set a vertical text and that too with horizontal letters. By specifying the text-orientation: upright and writing-mode: vertical-rl, we can display vertical text with horizontal CSS. Syntax The syntax of CSS writing-mode and text-orientation property is as follows − Selector { writing-mode: /*value*/ text-orientation: /*value*/ } Create a Vertical Text with Horizontal Letters The following example illustrate how to create a vertical text with horizontal letters − Text Orientation To create a vertical text, set the text-orientation to upright − text-orientation: upright; ... Read More

How to Create a Triangle Using CSS clip-path?

AmitDiwan
Updated on 14-Dec-2023 12:27:20

461 Views

On a web page, you can create a triangle easily. Use the clip-path property or even the child selector concept can be used. The clip-path allows a user to clip an element to a shape. This shape is to be set polygon to create a triangle. Syntax The syntax of CSS clip-path property is as follows − Selector { clip-path: /*value*/ } Create a Triangle using the clip-path The following example illustrate CSS clip-path property. Here, we have set the clip-path shape to polygon to create a triangle. This is done using the polygon() method ... Read More

How to Create a Comment Box with a Containing Text Using CSS

AmitDiwan
Updated on 10-Feb-2021 13:05:31

468 Views

Comment box can be created using clip-path propertySyntaxThe syntax of CSS clip-path property is as follows −Selector {    clip-path: /*value*/ }ExampleThe following examples show how we can create a comment box using CSS. Live Demo                    .cb {             position: relative;             padding: 2%;             border-radius: 8%;             width:25%;          }          .cb::after {             content: "";     ... Read More

Change Bullet Color for Lists with ::marker CSS Selector

AmitDiwan
Updated on 30-Oct-2023 14:34:44

933 Views

The ::marker selector is used to select the marker of a list item in CSS. It updates the marker properties on bullets or numbers i.e., unordered or ordered lists. We will use the ::marker selector with the color property to change the bullet color. Syntax The syntax of CSS ::marker selector is as follows − Selector::marker { attribute: /*value*/; } The following examples illustrate CSS ::marker selector. Create a Colored Vertical Bullet List To add a color to the bullet list, set the ::marker selector. The bullet lists get displayed vertically by default. Here, we ... Read More

How to Animate Bullets in Lists using CSS?

AmitDiwan
Updated on 15-Nov-2023 18:02:24

496 Views

To style bullets in an unordered list, we can use the list-style property. We will see examples to animate ordered and unordered lists. Syntax The syntax of CSS li-style property as follows − li { list-style: /*value*/ } Style and Animate Unordered List The following example illustrate CSS list-style property to style the list items in an unordered list i.e. . To animate it, we have set styles on hover using the :hover selector − li:hover { box-shadow: -10px 2px 4px 0 blue!important; font-size } Example Let us see an example to style and animate an unordered list on a web page − ... Read More

Setting a Fixed Width for Items in CSS Flexbox

AmitDiwan
Updated on 26-Dec-2023 15:55:14

2K+ Views

To set a fixed width for items in flexbox, use the flex property. The flex is a shorthand property for the flex-grow, flex-shrink, and flex-basis properties as shown below. The flex item is growable, can’t shrink, and initial length is set to 100% − flex: 1 0 100%; Above, shows − flex-grow is 1 i.e., growable flex-shrink is 0 i.e., can’t shrink flex-basis is 100% Syntax The syntax of CSS flex property is as follows − Selector { flex: /*value*/ } As shown above, the value can be − flex-grow ... Read More

Hide Dropdown Arrow for Select Input with CSS appearance

AmitDiwan
Updated on 02-Nov-2023 12:02:48

2K+ Views

We use the appearance property to style an element according to the platform-native style of the user’s operating system. Syntax The syntax of CSS appearance property is as follows − Selector { appearance: /*value*/; -webkit-appearance: /*value*/; /*for Safari and Chrome */ -moz-appearance: /*value*/; /*for Firefox */ } The following examples illustrate CSS appearance property − Hide Dropdown Arrow for Input Type Number In this example, we have shown how to hide the dropdown arrow for the . For that, we gave set the appearance property to none − ... Read More

Custom Radio Buttons with CSS appearance Property

AmitDiwan
Updated on 01-Nov-2023 14:01:18

847 Views

We use the appearance property to style an element according to the platform-native style of the user’s operating system. Syntax The syntax of CSS appearance property is as follows − Selector { appearance: /*value*/; -webkit-appearance: /*value*/; /*for Safari and Chrome */ -moz-appearance: /*value*/; /*for Firefox */ } Create a Custom Radio Button To create a custom custom checkbox, we have set the following style with border-radius and appearance. The appearance is set to none − input[type=radio] { appearance: none; -webkit-appearance: none; ... Read More

Advertisements