Adding Styles Using CSS

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 36:- Adding Styles Using CSS

  1. CSS (Cascading Style Sheets) is a stylesheet language used for describing the look and formatting of a HTML document. CSS can be used to control the layout, font, color, and other visual aspects of a web page.

    CSS can be added to a HTML document in three ways:

    1. Inline Styles: Inline styles are added directly to HTML elements using the style attribute. For example:

    cssCopy code

    <p style="color: blue;">This is a blue paragraph.</p>

    1. Internal Styles: Internal styles are defined within the <head> section of a HTML document using the <style> tag. For example:

    phpCopy code

    <head>  <style>    p {      color: blue;    }  </style> </head> <body>  <p>This is a blue paragraph.</p> </body>

    1. External Styles: External styles are stored in a separate .css file and are linked to the HTML document using the <link> tag. For example:

    phpCopy code

    <head>  <link rel="stylesheet" type="text/css" href="style.css"> </head> <body>  <p class="blue">This is a blue paragraph.</p> </body>

    The content of style.css file:

    cssCopy code

    .blue {  color: blue; }

    In CSS, styles are applied to HTML elements using selectors. Selectors can be based on the element type (e.g. p), class (e.g. .blue), or ID (e.g. #red). For example:

    cssCopy code

    p {  color: blue; } .blue {  color: blue; } #red {  color: red; }

    CSS can also be used to control the layout of a web page using the display, float, position, and flex properties. For example:

    cssCopy code

    header {  background-color: lightgray;  display: flex;  justify-content: space-between;  align-items: center;  padding: 20px; } main {  display: flex;  justify-content: center; } aside {  width: 200px;  background-color: lightgray;  padding: 20px; } footer {  background-color: lightgray;  text-align: center;  padding: 20px; }

5. Intro To CSS

Comments: 2

profile
@niteshguptav63
17-Nov-2024, 01:39 PM

I am not able to access videos from second class and further. I have already completed first class

profile
@niteshguptav63
16-Nov-2024, 10:56 AM

When will I get my course?

profile
@admin79
17-Nov-2024, 01:29 PM

Now, Your query was resolved.

Frequently Asked Questions (FAQs)

How do I register on Sciaku.com?
How can I enroll in a course on Sciaku.com?
Are there free courses available on Sciaku.com?
How do I purchase a paid course on Sciaku.com?
What payment methods are accepted on Sciaku.com?
How will I access the course content after purchasing a course?
How long do I have access to a purchased course on Sciaku.com?
How do I contact the admin for assistance or support?
Can I get a refund for a course I've purchased?
How does the admin grant access to a course after payment?