Cascading Style Sheets or CSS, in short, is a style sheet language used for describing the presentation of a document written in a markup language like HTML. At least, we as bloggers need to have a bit of knowledge about CSS and HTML.

Now we will briefly describe changing the appearance of our blog design, whether it changes the position of a block element by editing the HTML section or through CSS with the help of the Inspection Tools that are available for each browser designed for the desktop.

Google Chrome Inspector GUI

How To use Chrome Dev Inspector

To use Inspect mode, simply, Right  Click mouse button at the desired area and then choose "Inspect". try to inspect elements below and look for data:message Value behind Quote within inspector and then type it at the form below to see if you inputting correct value.

Inspect Me!

Value of data-message:


Declare CSS Style to an element

In this part, we are trying to add red background-color to the element below
Add A Background Color To Me!

  1. Right-click element above and click inspect.
  2. Click under element.style Filter text of the Styles tab.
  3. Type background-color then press Enter or :
  4. Type red to add red color to its background.
Style tab GUI has :hov button, it uses to make element state change to :active, :focus, :hover, and :visited. While .cls mean to add class to the selected element, and New Style Rule [+] automatically declare highlighted element as the selector.

New style rule added from inspector will be stored under inspector-stylesheet.css that we can edit directly from source pane tab. Google Chrome Developer page has aslo own Guide, see Get Started With Viewing And Changing CSS.

There are three ways of inserting a style sheet:
  • Internal style sheet
    this is a CSS declaration inside <style> and </style> somewhere in the same page.
    <head>
        <style>
            h1 {
                color: red;
            }
        </style>
    </head>
  • External style sheet
    for example : <link rel="stylesheet" href="my-external-style.css"> In the code, we have included the link of my-external-style.css file using the link element. We then write all of our CSS in a separate stylesheet called my-external-style.css without <style> tag so that it’s easily manageable.
            h1 {
                color: red;
            }
    
  • Inline style
    CSS style that is typed inside element.style are written directly to the element e.g <div style='background-color:red'/> we call it inline style.
Using both inline or internal style, when we finished editing, maybe we need to synchronize with the CSS code that is inside the page section manually. Well, its different story if we use external CSS, after we have finished editing try to press the name of our external .CSS file from the style tab in the inspector, we will found our CSS code is updated automatically, this called live editing. so we only need to save the file and then upload it again.

CSS Selectors

CSS is a design language which is used to style HTML elements. And in order to style elements, first, we have to select them. There are different ways we can select HTML elements.
Example HTML code
<div class='container' id='id-container'>
    <h1 class='heading' id='id-h1'> This is heading </h1>
    <p class='paragraph' id='id-p'> This is text from Paragraph </p>
</div>>

1. By Element
The first way to select an HTML element is by simply using the Element name.
div {
    margin: 10px;
}
h1 {
    font-size: 20px;
}
p {
    color: green;
}

2. By Class
The way of selecting HTML elements by using the class attribute. In HTML, we can assign different classes to our elements. Each element can have multiple classes, and each class can also be applied to multiple elements as well. Selected class described in CSS by adding . (dot) prefix to its class name.
.container {
    margin: 10px;
}
.heading {
    font-size: 20px;
}
.paragraph {
    color: green;
}

3. By ID
Like classes, we can also use IDs to select HTML elements and apply a style to them. The only difference between class and ID is that one ID can be assigned to only one HTML element, so ID must be unique and there is only one ID on the page. We can select id by adding # as a prefix.
#id-container {
    margin: 10px;
}
#id-heading {
    font-size: 20px;
}
#id-p {
    color: green;
}

4. Select multiple elements
We can select multiple element separate by a comma.
.heading, .paragraph {
    font-size: 20px;
}

For further reading see complete selector guide at Mozilla Developer web.
For complete CSS Reference Mozilla CSS Reference.

Share This

25 comments:

  1. Nice knowledge gaining article. This post is really the best on this valuable topic.
    Calibration Services

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
    WordPress development company in Chennai

    ReplyDelete
  4. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.
    Check out my site for more tips Minnesota Web Design

    ReplyDelete
  5. Mouse clicking is something can win you game, CPS TEST Game can test your mouse...

    ReplyDelete
  6. Having an E-commerce store that is optimized for the customer requirement is not an easy thing. I definitely do check and correct the E-commerce mistakes and boost my E-commerce conversion rate. Thanks for sharing!
    Wordpress Website Development
    Wordpress Plugin Developer
    Wordpress Development Company
    Wordpress Theme Development
    Wordpress Web Development

    ReplyDelete
  7. Excellent post. I always check this type of blog, and I’m impressed with Extremely useful info, I care for such information a lot. I am exploring this particular info for a long time. Thanks to this blog my exploration has ended. Singapore web designer

    ReplyDelete
  8. Nice post, it was nice to see this article. It was really appreciable. Thank you so much for sharing such an informative article. Website Designer Ireland

    ReplyDelete
  9. This is a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it
    website designing consultant

    ReplyDelete
  10. Thank you very much for sharing this helpful post. Please check out this awesome website https://onlineconvertfree.com/converter/images/

    ReplyDelete
  11. How does the various products mentioned on the list compare, and which one can be said to be the best?
    https://seogeek.sg/

    ReplyDelete
  12. Who has been able to pick out the best service among those listed on this site?
    singapore google seo course

    ReplyDelete
  13. This is really easy to style a blogger theme. However, hiring a graphic design agency is also useful that can help people to have best design in hand.

    ReplyDelete
  14. Nice article about how to make some awesome themes using html & css. You can get good theme customization and website development services with them.

    ReplyDelete
  15. Thank you for sharing this useful information, I will regularly follow your blog.Excellent post, thanks for sharing, it’s indeed very helpful for new blogger like me Game Development Outsourcing

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Thank you for sharing this useful information, I will regularly follow your blog.Excellent post, thanks for sharing, it’s indeed very helpful for new blogger like me Maxlearners

    ReplyDelete

  18. I have been reading for the past two days about your blogs and topics, still on fetching! Wondering about your words on each line was massively effective. Techno-based information has been fetched in each of your topics. Sure it will enhance and fill the queries of the public needs. Feeling so glad about your article. Thanks…!
    selenium training in chennai
    selenium online courses best selenium online training
    selenium testing training
    selenium classes

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. The information you have posted is very useful for online dating. The sites you have referred was good. Thanks for sharing.. website designing consultant

    ReplyDelete
  21. It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing. web hosting comparison

    ReplyDelete
  22. Wonderful post. I simply stumbled upon your weblog and wanted to mention that I have
    truly loved surfing around your blog posts.
    You can find more information regarding software services click herebest software solution in hyderabadREPLYDELETE

    ReplyDelete
  23. You are providing good knowledge. It is really helpful and factual information for us and everyone to increase knowledge. Continue sharing your data. Thank you. Read info about Web Design and development

    ReplyDelete

About
BloggerBasics101 is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Misc