CSS Advanced #1
CSS
- CSS Rounded Corners
border-radius
property, you can give any element "rounded corners".Example :
#rcorners1 {
border-radius: 25px;
background: #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
Four values - border-radius: 15px 50px 30px 5px;
- CSS Overflow
The overflow
property specifies whether to clip the content or to add scrollbars when the content of an element is too big to fit in the specified area.
The overflow
property has the following values:
visible
- Default. The overflow is not clipped. The content renders outside the element's box
hidden
- The overflow is clipped, and the rest of the content will be invisible
scroll
- The overflow is clipped, and a scrollbar is added to see the rest of the content
auto
- Similar toscroll
, but it adds scrollbars only when necessary
width: 200px;
height: 50px;
background-color: #eee;
overflow: visible;
}
- CSS Navigation Bar
<li><a href="default.asp">Home</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">About</a></li>
</ul>
list-style-type: none;
margin: 0;
padding: 0;
}
list-style-type: none;
margin: 0;
padding: 0;
width: 60px;
}
li a {
display: block;
}
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
position: fixed;
top: 0;
width: 100%;
}
position: fixed;
bottom: 0;
width: 100%;
}
Add the name of the specified icon class to any inline HTML element (like
<i>
or <span>
).Use font-awsome Icons:
<script src="https://kit.fontawesome.com/yourcode.js"></script>
Example:
<i class="fas fa-cloud"></i>
<i class="fas fa-heart"></i>
<i class="fas fa-car"></i>
<i class="fas fa-file"></i>
<i class="fas fa-bars"></i>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
Example:
<i class="material-icons">cloud</i>
<i class="material-icons">favourite</i>
<i class="material-icons">attachment</i>
<i class="material-icons">computer</i>
<i class="material-icons">traffic</i>
CSS Links:
The four links states are:
a:link
- a normal, un-visited link
a:visited
- a link the user has visited
a:hover
- a link when the user mouses over it
a:active
- a link the moment it is clicked
In these chapters you will learn about the following properties:
text-shadow
box-shadow
text-shadow: 2px 2px;
}
text-shadow: 2px 2px 5px red;
}// adding a blur effect to the shadows
text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF;
}
box-shadow: 10px 10px;
CSS also supports 3D transformations.
With the CSS transform
property you can use the following 3D transformation methods:
rotateX()
rotateY()
rotateZ()
transform: rotateX(150deg);
}
<a class="active" href="#home">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
<a href="#about">About</a>
</div>
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
position: fixed;
height: 100%;
overflow: auto;
}
.sidebar a {
display: block;
color: black;
padding: 16px;
text-decoration: none;
}
.sidebar a.active {
background-color: #4CAF50;
color: white;
}
.sidebar {
width: 100%;
height: auto;
position: relative;
}
.sidebar a {float: left;}
div.content {margin-left: 0;}
}
Comments
Post a Comment