Issue
I want to create custom tags in html to do some sort of thing like is there any way to turn html and css divs into tags?
.me {
width: 100px;
height: 100px;
background-color: red;
}
<div class="me"></div><br>
<p>Make the above div a "redbox" tag or something</p>
Solution
You can so something like this:
redbox {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
<redbox></redbox>
<!-- OR -->
<redbox />
You can pass attributes like this:
redbox {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
redbox[center] {
margin: auto;
}
<redbox center/>
OR
redbox {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
redbox[align="center"] {
margin: auto;
}
<redbox align="center" />
Answered By - Manas Khandelwal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.