CSS Internal Style Sheet
Cascading Style Sheets come in three flavors: internal, external, and inline. When using internal CSS, <style> tag must be added inside the <head> tag.
The <style> tag is used to define style information for an HTML document.Inside the style element, specify how HTML elements should render in a browser:
Syntax:
<html-tag style="css-property1: value; css-property2: value;"> </htmltag>
Example: 1
<html>
<head>
</head>
<body>
<p style="background: blue; color: white;">Character enhances beauty. The beauty of my character will attract everyone to me.</p>
</body>
</html>
<head>
</head>
<body>
<p style="background: blue; color: white;">Character enhances beauty. The beauty of my character will attract everyone to me.</p>
</body>
</html>
Output
Character enhances beauty. The beauty of my character will attract everyone to me.
Example: 2
<html>
<head>
<style> p{ border:5px outset red; width: 300px; color:#0658ac; padding: 10px; margin: 20px; position: absolute; top: 50px; left:200px; } <style>
<body>
<p>Character enhances beauty. The beauty of my character will attract everyone to me.</p>
</body>
</html>
Output
Character enhances beauty. The beauty of my character will attract everyone to me.
Another Way:
<html>
<head>
</head>
<body>
</html>
<head>
</head>
<body>
<p style="border:5px outset red; width: 300px; color:#0658ac; padding: 10px;
margin: 20px; position: absolute; top: 50px; left:200px;">Character enhances beauty. The beauty of my character will attract everyone to me.</p>
</body></html>
Output
Character enhances beauty. The beauty of my character will attract everyone to me.
No comments:
Post a Comment