In the ultimate guide to CSS tutorial, you will learn about the CSS and how CSS relates to HTML and the advantages and disadvantages of CSS.
Remember HTML(Hypertext Markup Language) used to web development language, HTML and CSS are co-related to each other.
What is CSS? How Does It Relate to HMTL (Hypertext Markup Language)?
CSS stands for Cascading style sheets is a simple design language that is used to making web pages presentable. means that with the CSS we make modify the look and feel part of a web page design.
you can control the style of the fonts, the color of the text, the spacing and margin between the paragraphs, background color, background-size, layout design, variations in display for all media screen devices size.
Hence, CSS provides powerful control over the presentation of HTML Documents. While HTML is used to structure a web document (which defining things like paragraph and heading, border, images and allows you to embed images, video, and other media), CSS comes through and specifies your document’s style—page colors, fonts, layouts are all determined with CSS.
Therefore, if we relate HTML and CSS then Suppose that if you think in a simple way HTML is old house design (technique) and CSS is modern house design Technique but both are related to each other but when you skip one of these two (HTML and CSS) you can not design the web pages.
Let’s see How Does CSS Work?
The Ultimate Guide to CSS brings style to your web pages by interacting with HTML (HyperText Markup Language) elements.
which HTML might look like this
furthermore, if you wanted to make Heading appear Green, font-size bigger and bold to people viewing your web page through a web browser, you’d use CSS code that looks like this:
As a result, In this case, “h2” (the Heading)- it’s the part of CSS code specifying, this HTML element will affect the CSS styling selector is written with the left of the curly bracket.
Which information is between curly brackets these are called the declaration, and between the curly, the bracket contains properties and values that are applied to the selector.
Therefore, we can understand the easy properties are those things like color, font size, padding, border, and margins. we can set the values for those properties.
As a result, of the above example, we can understand the easy color, font-size, font-weight are properties and green, 36px, bold is the values for properties.
<p>Thisisparagraph of summary</p>
also, If you wanted to make Paragraph appear font-color brown, font-size smaller and normal to people viewing your web page through a web browser, you’d use CSS code that looks like this:
therefore, In the above example, we can understand the easy color, font-size, font-weight are properties and brown, 14px, normal is the values for properties.
Let’s Understand the Internal, External or Inline CSS?
The Ultimate Guide to CSS there is three methods to add that CSS code or style Sheet to your HTML pages. 1- Internal or Embedded stylesheet or CSS code 2- External Stylesheet or CSS code 3- Inline Stylesheet or CSS code
Therefore, when we use the External Style Sheet or CSS code method then stylesheet is saved as .css files and this external stylesheet can be used to determine the appearance of a whole website through one file (external stylesheet like as newshtylesheet.css) rather than adding individual instances of CSS code to every HTML element which you want to adjust.
hence, in order to external stylesheet which you use, you need to add external stylesheet in your .html files need to include a header section.
How to add Internal CSS code in HTML File
In HTML Document the internal style sheet is used to adding a unique style for a single document. It is defined in <head> section of the HTML page inside the <style> tag.
consequently, let’s see the Example of Internal CSS Code
<h1>Example forInternal CSS</h1>
<p>Cascading Style Sheet isastyle language that defines layout of HTML
documents,CSS properties such asbackground,border,font,float,display,