Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML Style
- border (all)
- :2px solid black;
- background (div, button, canvas, img)
- :green;
- :url('http://www.w3schools.com/images/colorpicker.gif');
- ##############################
- <parent>
- <child>
- <child2></child2>
- <child2></child2>
- </child>
- <child></child>
- </parent>
- size (div, button, canvas, img)
- width:100px; :auto; :100%;
- height:100px; :auto; :100%;
- auto:
- div => 100%
- rest => matches content
- div matches content => display:inline-block;
- ###############################################
- <div style="">
- <a style="border:2px solid black;background:green;">Hello</a>
- </div>
- <div style="border:2px solid black;background:green;">
- <a style="">Hello</a>
- </div>
- <div style="border:2px solid black;background:green;display:inline-block">
- <a style="">Hello</a>
- </div>
- HTML Style
- position (div, button, canvas, img)
- top:100px;
- left:100px;
- position:absolute;
- float:left;
- margin-left:10px;
- margin-top:10px;
- Position relative to normal position:
- margin-left && margin-top
- Position relative to parent top-left corner:
- position:absolute;
- top && left
- and make sure parent is also position:absolute;
- Containers next to each other:
- float:left; (on both)
- <div style="border:2px solid black; width:500px; height:500px;margin-left:10px;margin-top:10px;">
- <div style="border:2px solid black; width:300px; height:300px;margin-left:100px;margin-top:100px;">
- <div style="
- border:2px solid green;
- width:100px;
- height:100px;
- "></div>
- <div style="
- border:3px solid red;
- width:100px;
- height:100px;
- "></div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement