Found 601 Articles for Front End Scripts

How to define multiple style rules for a single element in CSS?

Samual Sam
Updated on 30-Jan-2020 07:55:52

827 Views

You may need to define multiple style rules for a single element. You can define these rules to combine multiple properties and corresponding values into a single block as defined in the following example: h1 {    color: #36C; font-weight: normal;    letter-spacing: .4em;    margin-bottom: 1em;    text-transform: lowercase; }Here all the property and value pairs are separated by a semicolon (;). You can keep them in a single line or multiple lines. For better readability, we keep them on separate lines.

Attribute Selectors in CSS

Lakshmi Srinivas
Updated on 30-Jan-2020 07:55:18

350 Views

You can also apply styles to HTML elements with particular attributes. The style rule below will match all the input elements having a type attribute with a value of text −input[type = "text"]{    color: #000000; }The following are the rules applied to attribute selector. p[lang] - Selects all paragraph elements with a lang attribute. p[lang="fr"] - Selects all paragraph elements whose lang attribute has a value of exactly "fr". p[lang~="fr"] - Selects all paragraph elements whose lang attribute contains the word "fr". p[lang|="en"] - Selects all paragraph elements whose lang attribute contains values that are exactly "en", or begin with "en-".Read More

ID Selectors in CSS

vanithasree
Updated on 30-Jan-2020 07:54:45

396 Views

You can define style rules based on the id attribute of the elements. All the elements having that id will be formatted according to the defined rule. #black {    color: #000000; }This rule renders the content in black for every element with id attribute set to black in our document. You can make it a bit more particular. For example:h1#black {    color: #000000; }This rule renders the content in black for only elements with id attribute set to black.The true power of id selectors is when they are used as the foundation for descendant selectors, For example:#black h2 ... Read More

Class Selectors in CSS

karthikeya Boyini
Updated on 30-Jan-2020 07:53:47

406 Views

You can define style rules based on the class attribute of the elements. All the elements having that class will be formatted according to the defined rule..black {    color: #808000; }This rule renders the content in black for every element with class attribute set to black in our document. You can make it a bit more particular. For example:h1.black {    color: #808000; }This rule renders the content in black for only elements with class attribute set to black.You can apply more than one class selectors to given element. Consider the following example:    This para will be ... Read More

Descendent Selectors in CSS

Samual Sam
Updated on 30-Jan-2020 07:25:02

366 Views

Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, style rule will apply to element only when it lies inside tag.ul em {    color: #FFFF00; }Suppose now for element and style rule applied to :ol strong {    color: #808000; }

Type Selectors in CSS

varma
Updated on 30-Jan-2020 07:24:30

889 Views

A selector is an HTML tag at which a style will be applied. This could be any tag like or etc.With the type selector, set for HTML tags like h1, h2, h3, p, etc:h2 {    color: #FF0000; }Set for p:p {    color: #800000; }

What is a Selector and how it is used in CSS?

Lakshmi Srinivas
Updated on 30-Jan-2020 07:23:49

157 Views

A selector is an HTML tag at which a style is applied. This could be any tag like or etc.The following figure describes what a Selector is:Let us see an example of Type Selector, to set color:h1 {    color: #36CFFF; }

Style Rules in CSS

Sreemaha
Updated on 30-Jan-2020 07:22:37

5K+ Views

CSS comprises of style rules interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts −Selector -  A selector is an HTML tag at which a style will be applied. This could be any tag like or etc.Property - A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.Value - Values assigned to properties. For example, the color property can have value either red or #F1F1F1 etcYou can put CSS Style Rule Syntax as ... Read More

Difference between specification and recommendation that introduced CSS

karthikeya Boyini
Updated on 30-Jul-2019 22:30:22

158 Views

The CSS Working Group creates documents called specifications. When a specification has been discussed and officially ratified by W3C members, it becomes a recommendation.These ratified specifications are called recommendations because the W3C has no control over the actual implementation of the language. Independent companies and organizations create that software.The World Wide Web Consortium or W3C is a group that makes recommendations about how the Internet works and how it should evolve.

Who maintains and governs CSS?

Samual Sam
Updated on 30-Jul-2019 22:30:22

356 Views

CSS invented by Håkon Wium Lie on October 10, 1994, and maintained by a group of people within the W3C called the CSS Working Group. The CSS Working Group creates documents called specifications. When a specification has been discussed and officially ratified by W3C members, it becomes a recommendation.These ratified specifications are called recommendations because the W3C has no control over the actual implementation of the language. Independent companies and organizations create that software.

Advertisements