
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to use internal CSS (Style Sheet) in HTML?
Cascading Style Sheets is used to format the presentation of a webpage.
CSS is used to style and layout web pages — you can control the presentation of the web page using, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features available within the css properties.
Internal CSS
Internal CSS is used to define within style tags for a single HTML page. It is defined inside the <head> tag of an HTML page, within a <style> tag element.
Example
Following is the example program, uses internal CSS for styling in HTML.
<!DOCTYPE html> <html> <head> <style> body {background-color:tan;} h1 {color: whitesmoke; font-family: cursive} p {color:whitesmoke; background-color: dimgrey; font-family: monospace} </style> </head> <body> <h1>HTML-HyperText Markup Language </h1> <p>The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser.</p> </body> </html>
Example
Following is the example program, uses internal CSS for styling for <ol> element in HTML.
<!DOCTYPE html> <html> <head> <style> ol.a { list-style-type: upper-roman; } </style> </head> <body> <h2>List</h2> <ol class = "a" > <li>GOT</li> <li>HOTD</li> <li>HBO</li> </ol> </body> </html>
Example
Following is the example program, uses internal CSS for styling for <table> element in HTML.
<!DOCTYPE html> <html> <head> <title>Inline CSS</title> <style> table, th, td { border: 3px solid; } </style> </head> <body> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>SS</td> <td>Rajamouli</td> </tr> <tr> <td>Prashant</td> <td>Neel</td> </tr> </table> </body> </html>
- Related Articles
- How to use inline CSS (Style Sheet) in HTML?
- How to use CSS style in PowerShell HTML Output?
- How to use inline CSS style for an element in HTML?
- How to import styles from another style sheet in CSS
- Rules to override Style Sheet Rule in CSS
- Embedded or internal Style Sheets in CSS
- Indicate what character set the style sheet written in with CSS
- What are the ways to include style sheet rules in an HTML document
- How to add comments in the style sheet blocks
- Style to highlight active HTML anchor with CSS
- How to use the tag to define style information for an HTML page?
- How do we use different CSS classes in HTML?
- How to use style attribute to define style rules?
- How to apply CSS style to the different elements having the same class name in HTML?
- How to style images with CSS?
