CSS Rotate Tutorial: Dive into our detailed CSS tutorial on creating engaging rotate effects. Whether you’re looking to rotate images or text, this guide covers all you need to know to enhance your web design skills. Using CSS rotate properties, you can achieve unique transformations that bring new life to your websites.
What You’ll Learn:
- CSS rotate: Understand the
rotate()
function and its parameters to control image and text rotation. - Rotate Images with CSS: Learn how to apply image rotation with examples and source code for practice.
- Rotate Text with CSS: Adding text rotation is a powerful way to make headers or buttons stand out.
Why Use CSS Rotate? The rotate
property in CSS provides an easy way to add visual interest without complex coding. Perfect for designers, beginners, and anyone looking to enhance their web pages.
This rotate CSS guide includes step-by-step instructions, downloadable source codes, and practical examples for real-life applications. If you want to rotate images or add flair to your text, our tutorial makes it easy to follow along.
source codes:
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<title> 1st website </title>
<style type=”text/css”>
body{
font-family: sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
}
.grid-container{
height: 100vh;
width: 90%;
margin: 0 auto;
gap:10px;
display: grid;
grid-template-areas:
‘header header header’
‘nav nav nav’
‘sidebar container container’
‘footer footer footer’;
grid-template-columns: 1fr 3fr;
grid-template-rows: auto auto 1fr auto;
}
img{
width:300px;
height:auto;
}
header{
grid-area: header;
background-color:#4CAF50 ;
color: white;
text-align: right;
padding: 0px 15px;
font-size: 24px;
}
nav{
grid-area: nav;
background-color: #4caf50;
padding: 0 15px;
text-align: left;
display: ruby;
}
h1{
padding: 10px;
background-color: white;
color: #135d08;
border-radius: 15px;
}
.container {
grid-area: container;
background-color: #ffffff;
padding: 15px;
}
.sidebar {
grid-area: sidebar;
background-color: #f4f4f4;
padding: 15px;
}
footer{
grid-area: footer;
background-color: #4CAF50;
color: white;
text-align: center;
padding: 10px;
}
nav, .container, .sidebar {
border: 1px solid #ddd;
}
nav ul li{
text-decoration: none;
display: inline-grid;
}
nav ul li a{
display: block;
text-decoration: none;
padding: 10px;
background-color: #135d08;
color: white;
border-radius: 10px;
}
nav ul li a:hover{
background-color: white;
color: #135d08;
}
</style>
</head>
<body>
<div class=”grid-container”>
<header>
Hoteline: 01234567890
</header>
<nav>
<h1> Website name </h1>
<ul>
<li> <a href=”#”> Home </a> </li>
<li> <a href=”#”> About </a> </li>
<li> <a href=”#”> services </a> </li>
<li> <a href=”#”> Contact </a> </li>
</ul>
</nav>
<aside class=”sidebar”>
<h2>Sidebar</h2>
<p> This is the sidebar. You can put links, ads, or other additional information here. </p>
</aside>
<div class=”container”>
<h2>Main Content</h2>
<p> This is the main content area. You can place your articles, blog posts, or other important information here. </p>
<img src=”image.jpg”>
</div>
<footer> Footer information </footer>
</div>
</body>
</html>
Video: