Using more than one CSS property : You can use more than one CSS property and value in a style attribute. All you have to do is use a semi-colon (;) to separate them.
Your browser will read all of the CSS properties and Here we’ve used two CSS properties apply them to your HTML element, so you can use as many as you need.
[html]
<body>
<div style="background-color: lightblue; float: right;">
Hello world. We have used two CSS properties.
</div>
</body>[/html]
Sample output of above code:
Hello world. We have used two CSS properties.
The code Explained:
[html]
<!–Here we’ve used two CSS properties–>[/html]
Above code snippet is an HTML comment code and does not get processed, it is used for documentation of code.
Look at how we can change both the background colour and position of a
< div >!
Related Posts:
How to make a Go-Back Input button with inline JavaScript
MORE CSS PROPERTIES
CODING WEB PAGES (HTML, CSS, & JavaScript)
I am a dedicated technology enthusiast with over 45 years of life experience, passionate about computers, AI, emerging technologies, and their real-world impact. As the founder of my personal blog, MiltonMarketing.com, I explore how AI, health tech, engineering, finance, and other advanced fields leverage innovation—not as a replacement for human expertise, but as a tool to enhance it. My focus is on bridging the gap between cutting-edge technology and practical applications, ensuring ethical, responsible, and transformative use across industries.
MiltonMarketing.com is more than just a tech blog—it's a growing platform for expert insights. We welcome qualified writers and industry professionals from IT, AI, healthcare, engineering, HVAC, automotive, finance, and beyond to contribute their knowledge. If you have expertise to share in how AI and technology shape industries while complementing human skills, join us in driving meaningful conversations about the future of innovation. 🚀