Skip to content
CodeHasBug
  • Home
  • Tutorial
    • HTML
    • CSS
    • Javascript
    • jquery
    • PHP
    • MySql
    • wordpress
  • Technology
    • Windows
    • Android
  • Social Media
    • WhatsApp
    • Facebook
    • Instagram

CSS

The abbreviation of Cascading Style Sheets is CSS. It is mainly used to design HTML elements.

How to style HTML elements?

We can style HTML elements in three ways i.e

  1. By using an external stylesheet.
  2. Use an internal stylesheet in the head section.
  3. Or we can use inline CSS.

The best way to use CSS by using an external stylesheet. In our CSS tutorial, we can use a different type of problem-solving by using the above ways.

External stylesheet:

We have to use .css as an external stylesheet extension. After that, it has to include in the document section like below-

<link href="your-css-filename.css" rel="stylesheet">

Internal stylesheet:

We can use an internal stylesheet in the section of a document or we can also write it inside the tag. We have to write all of our CSS code inside the style tag.

<style>..</style>

 

tag. For example-

<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #fff;
}
p {
color: red;
}
</style>
</head>
<body>
<style>
h1 {
color: blue;
}
</style>
<h1>This is a heading with blue color.</h1>

<p>This is a paragraph with red color.</p>

</body>
</html>

Inline CSS:

We can also use the CSS code inside an element. For example

<p style="color: green;">This is a paragraph with red color.</p>

But this is not recommended as we have to use this in each element to style it. So we can use internal or external method. It is very helpful whenever we have to change a style of an element dynamically.

How to make certain text unselectable with CSS?

How to make certain text unselectable with CSS?

March 28, 2022March 28, 2022 by Ashis Biswas

Sometimes we need to do something that the user can not select the certain text or whole text of some pages. So the question is …

Read more

How to add watermaker various way in HTML and CSS

How to add watermark various way in HTML and CSS

March 25, 2022March 25, 2022 by Ashis Biswas

In this simple tutorial, we are going to learn how to add watermarks in different ways through HTML and CSS. Suppose you want to show …

Read more

How to make a DIV circular in CSS

How to make a DIV circular in CSS

March 23, 2022 by Ashis Biswas

DIVs are often used in conjunction with other HTML elements, such as images and tables, to create a layout for a web page or web …

Read more

How to create 3X3 grid using CSS

How to create a 3X3 grid using CSS

March 23, 2022March 23, 2022 by Ashis Biswas

Introduction: In this tutorial, we will see how to create a simple 3X3 grid by using CSS grid. This is a basic 3X3 grid layout. …

Read more

Without Using Fixed Position Keep Footer at Bottom of a Page When Scrolling

Without Using Fixed Position Keep Footer at Bottom of a Page When Scrolling

March 23, 2022March 23, 2022 by Ashis Biswas

A sticky footer is always showing to the bottom of a browser window. But sometimes we don’t have enough content to lower the footer. In …

Read more

Post navigation
Newer posts
← Previous Page1 Page2 Page3

Enjoying the articles? I would appreciate a coffee to help me keep writing and coding!

Trending Now

  • PHP replace space with dash
  • jQuery disable button
  • CSS make text unselectable
  • Prevent copying website content
  • PHP post array data
  • PHP foreach break

Recent Posts

  • How to create Back To Top Button in jQuery
  • Why JavaScript error “is not a function” occurs
  • What is the best way to validate an email address in JavaScript?
  • How to create API Key Generator
  • Check if a string contains a specific word in PHP?

Recent Comments

  • Noradavis on How to create a spacebar counter
  • Michelle stuart on How to display images from a folder in PHP
  • John on How to add watermark various way in HTML and CSS
  • Ashis Biswas on How to display images from a folder in PHP
  • Elber Galarga on How to Disable Or Enable Copy and Paste on Website

Categories

  • Android
  • Android Apps
  • CSS
  • Featured
  • HTML
  • Instagram
  • Javascript
  • jquery
  • PHP
  • Technology
  • Tutorial
  • Web Design
  • WhatsApp
  • Windows
  • wordpress

  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • DMCA policy
© 2019 - 2022 CodeHasBug. All rights reserved. | Sitemap | DMCA.com Protection Status | Ad Partner Ezoic
  • Home
  • Tutorial
    • HTML
    • CSS
    • Javascript
    • jquery
    • PHP
    • MySql
    • wordpress
  • Technology
    • Windows
    • Android
  • Social Media
    • WhatsApp
    • Facebook
    • Instagram