0% found this document useful (0 votes)
18 views5 pages

Css Property

Uploaded by

sujithasekar22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

Css Property

Uploaded by

sujithasekar22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

CSS PROPERTY

*************

1. BACKGROUND
==============
body {
background-color: #ffffff;
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-color: rgba(211, 211, 211, 0.2); //White
background-color: rgb(73 68 68 / 50%); //Black

2. MARGIN
========
p {
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
}

3. BORDER
==========
p {
border-style: solid;
border-color: red;
border-bottom: 6px groove red;
border-radius: 5px;
border-left: 3px solid rgba(204, 50, 30, 0.7294117647); //Horizontal line for
div

4. PADDING
===========
div {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}

5. BOX MODEL
============
p {
border: 2px solid black;
outline: #4CAF50 solid 5px;
margin: auto;
padding: 20px;
text-align: center;
}

6. TEXT
=======
p {
color: hotpink;
text-align: left;
text-decoration-line: underline;
text-transform: capitalize;
SPACE
*****
letter-spacing: 5px;
text-indent: 50px;
SHADOW
*******
text-shadow: 2px 2px red;
text-shadow: 2px 2px 5px red; //blur effect (5px)
}

7. CSS ICONS
=============

<script src="https://kit.fontawesome.com/a076d05399.js"
crossorigin="anonymous"></script>
<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://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<i class="glyphicon glyphicon-cloud"></i>
<i class="glyphicon glyphicon-remove"></i>
<i class="glyphicon glyphicon-user"></i>
<i class="glyphicon glyphicon-envelope"></i>
<i class="glyphicon glyphicon-thumbs-up"></i>

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?


family=Material+Icons">
<i class="material-icons">cloud</i>
<i class="material-icons">favorite</i>
<i class="material-icons">attachment</i>
<i class="material-icons">computer</i>
<i class="material-icons">traffic</i>

8. CSS LINK
============
/* unvisited link */
a:link {
color: red;
text-decoration: none;
}

/* visited link */
a:visited {
color: green;
text-decoration: none;
}

/* mouse over link */


a:hover {
color: hotpink;
text-decoration: underline;
}

/* selected link */
a:active {
color: blue;
text-decoration: underline;
}

9. DISPLAY
===========
span {
display: block;
display: inline-block;
}
h1.hidden {
visibility: hidden; (OR)
display: none;
}

10. POSITION (Used for display one image over another image)
=============

position: sticky; // it won't move even if we scroll

main-div {
position: relative;
width: 400px;
height: 200px;
border: 3px solid #73AD21;
}

inner-div {
position: absolute;
top: 80px;
right: 0;
width: 200px;
height: 100px;
border: 3px solid #73AD21;
}

11. Z-INDEX (-1 => Display image back of text)


============ (1 => display image front)
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}

12. OVERFLOW
=============
div {
overflow-x: hidden; /* Hide horizontal scrollbar */
overflow-y: scroll; /* Add vertical scrollbar */
overflow: auto; (or) overflow: scroll;
overflow: hidden;
overflow: visible;
}

13. OPACTIY
============
img {
opacity: 0.5;
}

img:hover {
opacity: 1.0;
}

POSITION
========

HTML
=====
<div class="parent">
<div class="relative-child">Relative Child</div>
<div class="absolute-child">Absolute Child</div>
</div>

CSS
====
.parent {
position: relative;
width: 300px;
height: 200px;
background-color: lightgray;
}

.relative-child {
position: relative;
top: 20px;
left: 20px;
width: 100px;
height: 50px;
background-color: blue;
}

.absolute-child {
position: relative;
top: 50px;
right: 20px;
width: 100px;
height: 50px;
background-color: red;
}

You might also like