Learn about how Cascading Style Sheets (CSS) can be used to style web pages.
Part of Computing ScienceWeb design and development
An element can be set to the left or right of its container, we do this by using the float property.
<html>
<head>
<style>
p.example {float:right}
</style>
</head>
<body>
<h1>float example</h1>
When we use float, we can send things to the left or right.
<p class="example">This text should be on the right</p>
</body>
</html>
If we wanted to change the text to float to the left, we would have to change p.example{float:right} to p.example{float:left}.