⚡ Rocket.net – Managed WordPress Hosting

⚡ MiltonMarketing.com  Powered by Rocket.net – Managed WordPress Hosting

Bernard Aybouts - Blog - MiltonMarketing.com

Approx. read time: 1.5 min.

Post: Alignment CSS properties

Alignment CSS properties: So far all our HTML elements have been in the same position on our page. The text-align and float CSS properties allow you to align (another way of saying position) text and other HTML elements on your page.

The text-align property lets you position your text to the left, right or centre of your page. Remember to use the American spelling “center” and include the hyphen ()

[html] <body>
<div style="text-align: center;">
Hello world with alignment……
</div>
<p>Hello World without alignment…..</p>
</body>[/html]

Sample output of above code:

Hello world with alignment……

Hello World without alignment…..

We can also use CSS to position HTML elements, such as a

[html]<div>[/html]

tags or images, to the left or right of the page. You use the float CSS property and set the value to the left or right.

[html] <body>
<div style="float: right;">
The Hello world program:<br/>
<img src="img3432.jpg" alt="The Hello world program"/>
</div>
</body>[/html]

The text-align and float CSS properties are easy ways to create an interesting layout for your web page.


Related Posts:

How do I install plugins in WordPress?

WordPress Posts vs Pages

MORE CSS PROPERTIES

Introduction to Batch File Viruses

CODING WEB PAGES (HTML, CSS, & JavaScript)

CODING WITH CSS: The style attribute

Tips and tricks for USING THE DOM API

Tips and Tricks for WRITING JAVASCRIPT code

Where Kids Learn to Code.

Redirect New Registered Users to a Specific Page – WordPress

Build to-do list web-app with code

Using more than one CSS property

Building a web page with HTML tags

The color CSS property

 

About the Author: Bernard Aybout (Virii8)

Avatar of Bernard Aybout (Virii8)
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. 🚀