top of page

Examples of Basic CSS Properties in Action:

  • Writer: compnomics
    compnomics
  • Feb 14, 2024
  • 1 min read

Here are some examples using the CSS properties mentioned that you can use on most of your webpages.







Font Properties:

h1 {
  font-family: "Roboto", sans-serif;
  font-size: 2em;
  font-weight: bold;
  color: #333;
}

p {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

Text Properties:

.center-text {
  text-align: center;
}

.underline {
  text-decoration: underline;
}

Background Properties:

.blue-background {
  background-color: #007bff;
}

.image-background {
  background-image: url("background.jpg");
  background-repeat: no-repeat;
}

Border and Margin Properties:

.bordered {
  border: 1px solid #ddd;
  padding: 10px;
  margin: 20px;
}

.no-margin {
  margin: 0;
}

Additional Basic Properties:

.wide-image {
  width: 80%;
  height: auto;
}

.fixed-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
}

These are just a few basic examples, and you can experiment and combine these properties to create various visual effects and layouts for your webpages. Remember to consult CSS documentation and tutorials for more advanced usage and best practices.

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page