Found 1566 Articles for CSS

Pseudo-classes and all CSS Classes

AmitDiwan
Updated on 26-Dec-2023 15:27:22

145 Views

The pseudo-class keywords are used to specify a special state of the selector to which it is added. This gives us more control and now we can target a selector when it is in specific state for e.g.: hover, checked, visited etc. Pseudo-classes The following are some key Pseudo-classes − :active = To select the active link :checked = To select every checked element :first-child = To select the first child of an element’s parent :first-of-type = To select the first element of its parent :focus = To select the element that has focus :hover = To select ... Read More

Specify Word Breaking Rules using CSS3

AmitDiwan
Updated on 27-Dec-2023 16:34:01

130 Views

To specify word breaking rules in CSS3, use the word-break property. This property is used to break the line. Let us see the syntax − word-break: value; The values include normal − The default line break rules. break-all − The word is broken at any character only if overflow occurs break-word − The word is broken at arbitrary-points to prevent overflow The following are the codes for specifying word breaking rules using CSS3 − Normal Word Breaking Rule The normal word breaking rule is the default rule − word-break: normal; Example Let us ... Read More

Advanced Selectors in CSS

AmitDiwan
Updated on 11-May-2020 10:39:38

505 Views

The Advanced Selectors in CSS includes Adjacent Sibling selector, attribute selector, direct child selector, nth-of-type selector, etc. It also includes General Sibling Selector, an example is shown below:h1 ~ h3Example of direct child selector −div > spanFollowing is the code showing advanced selectors in CSS −Example Live Demo #red {    color: red; } .green {    background: green; } ul:nth-of-type(1) {    background: rgb(0, 174, 255); } ul + h3 {    border: 4px solid rgb(19, 0, 128); } a[href="https://www.wikipedia.org"] {    font-size: 25px; } h1 ~ h3 {    font-size: 40px; } div > span {   ... Read More

CSS Image Opacity for All Web Browsers including IE 8 and less

AmitDiwan
Updated on 11-May-2020 10:41:13

200 Views

The property opacity is the ultimate and modern solution and works for Firefox 0.9+, Safari 2, opera 9+, IE 9+ and every version of Google Chrome. The -moz-opacity property is the opacity property for Firefox versions older than 0.9 while the –khtml-opacity property is for safari versions starting with 1. The filter property is for IE browsers from 5 to 9 to give opacity like effect.Following is code for image opacity using CSS for all browsers −Example Live Demo body{    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } img {    width:270px;    height:200px; } .transparent{   ... Read More

Handling Text Overflow in CSS3

AmitDiwan
Updated on 31-Oct-2023 11:26:32

123 Views

The text-overflow property is used in CSS3 to determine how overflowed content that is not displayed is signalled to users. Syntax The following is the syntax of the text-overflow property − text-overflow: value; The value can be clip, ellipsis, string, and initial. You can set any text using the string value. The ("...") t is shown for the clipped text when the ellipsis value is used. The following is the code for handling text overflow in CSS3 − Clip the Text In this example, the overflow text is clipped and cannot be accessed using the text-overflow property with ... Read More

Setting the size of the radial gradients using CSS

AmitDiwan
Updated on 27-Dec-2023 16:29:59

932 Views

To set the size of the radial gradient, use the radial-gradient() function. This function sets a radial gradient as the background image. The second parameter in the function is to be set as the size you want as in the below example − background-image: radial-gradient(40% 50px at center, rgb(30, 255, 0), rgb(0, 195, 255), rgb(128, 0, 32)); Possible values are farthest-corner (default), closest-side, closest-corner, and farthest-side. Following is the code for setting the size of the radial gradients using CSS. Let us first see the complete syntax of the radial gradient. Syntax The following is the syntax of ... Read More

How to create CSS3 Transition Effects?

AmitDiwan
Updated on 11-May-2020 10:21:50

115 Views

To create CSS3 Transition Effects, use the transition property. Following is the code for creating transition effects using CSS3 −Example Live Demo .container div {    width: 300px;    height: 100px;    background: rgb(25, 0, 255);    border: 2px solid red;    transition: width 2s; } .container:hover div {    width: 100px; } Transition effects example Hover over the above div to reduce its width OutputThe above code will produce the following output −On hovering above the div −

Working with CSS3 3D Transform Functions

AmitDiwan
Updated on 21-Dec-2023 17:03:41

113 Views

Using with 3d transforms, we can move element to x-axis, y-axis and z-axis. The following are some of the methods of CSS3 3D Transform − S.No. Value & Description 1 matrix3d(n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n)Used to transforms the element by using 16 values of matrix 2 translate3d(x, y, z)Used to transforms the element by using x-axis, y-axis and z-axis 3 translateX(x)Used to transforms the element by using x-axis 4 translateY(y)Used to transforms the element by using y-axis ... Read More

How to create Border Images in CSS?

AmitDiwan
Updated on 14-Dec-2023 15:47:34

234 Views

A paragraph can be bordered easily on a web page with HTML and CSS. With that, to border the paragraph, we can also use an image. To create border images in CSS, use the border-image property. The following is the syntax of the border-image property − Syntax border-image: value; The value can be − border-image-source − The source of the image to be set as border border-image-slice − Slice the border image. The image is slice in the following sections− four corners, four edges and the middle. border-image-width − width of the border image border-image-outset − ... Read More

How to create CSS3 Rounded Corners?

AmitDiwan
Updated on 14-Dec-2023 16:24:42

180 Views

The rounded corner of an element is set on a web page using the border-radius property in CSS3. You can set the shape of the rounded corners with − length − Set shape of the corners in length units. Default is 0. Read about length units % − Set the shape in percentage Let us see two examples to set rounded corners for a container and an image. Create rounded corners We have two divs here to show the difference between a normal and a container with rounded corners − Rounded Corners Default corners Example The ... Read More

Advertisements