Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to set font size using CSS Measurement Unit vmin?
To set font size with CSS Measurement Unit vmin, try to run the following code: This div has relative positioning.
Read MoreIncluding an external stylesheet file in your HTML document
The element can be used to include an external style sheet file in your HTML document.An external style sheet is a separate text file with .css extension. You define all the Style rules within this text file and then you can include this file in any HTML document using element.Consider a simple style sheet file with a name new.css having the following rules:h1, h2, h3 { color: #36C; font-weight: normal; letter-spacing: .4em; margin-bottom: 1em; text-transform: lowercase; }Now you can include this file new.css in any HTML document as follows:
Read MoreRules to override Style Sheet Rule in CSS
The following is the rule to override any Style Sheet Rule.Any inline stylesheet takes the highest priority. Therefore, it will override any rule defined in ... tags or rules defined in an external style sheet file.Any rule defined in ... tags will override rules defined in any external style sheet file.Any rule defined in external style sheet file takes the lowest priority, and rules defined in this file will be applied only when above two rules are not applicable
Read MoreHow to use style attribute to define style rules?
You can use style attribute of any HTML element to define style rules. These rules will be applied to that element only. Here is the generic syntax:The following is an example: This is inline CSS
Read MoreWhat are the ways to include style sheet rules in an HTML document
To include stylesheet rules, use the element or style attribute or even external stylesheet using .The element can be used to include an external style sheet file in your HTML document.An external style sheet is a separate text file with .css extension. You define all the Style rules within this text file and then you can include this file in any HTML document using element.Here is the syntax of including external CSS file: The following are the attributes of a element:AttributeValueDescriptionTypetext/cssSpecifies the style sheet language as a content-type (MIME type). This attribute is required.HrefURLSpecifies ...
Read MoreWorking with Inline CSS
Associate styles with your HTML document using methods inline CSS and External CSS.You can use style attribute of any HTML element to define inline style rules. These rules will be applied to that element only. Here is the generic syntax:The following is the attribute:AttributeValueDescriptionstylestyle rulesThe value of style attribute is a combination of style declarations separated by a semicolon (;).Let us see an example: This is inline CSS
Read MoreUsage of text-transform property in CSS
The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.ExamplePossible values are none, capitalize, uppercase, lowercase. This will be capitalized This will be in uppercase This will be in lowercase
Read MoreWorking with <style> element for CSS
You can put your CSS rules into an HTML document using the element. This tag is placed inside ... tags. Rules defined using this syntax will be applied to all the elements available in the document.ExampleFollowing is an example of embedded CSS using the element: body { background-color: linen; } h1 { color: maroon; margin-left: 40px; } This is a heading This is a paragraph.
Read MoreHow to define multiple style rules for a single element in CSS?
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.
Read MoreClass Selectors in CSS
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