CodeLab
Tutorials For Everyone
Run
Learn CSS
<!Doctype HTML> <html> <head> <title>CSS Padding With Element Width</title> <style> .div1{ padding: 100px; width: 200px; background: #555; color: #fff; } .div2{ padding: 0; width: 200px; background: #3949ab; color: #fff; } </style> </head> <body> <h2>CSS Padding with Element Width</h2> Padding is added to the total width of the element. <div class="div1"> This div element has width of 200px with 100px padding. </div> <div class="div2"> This div element has width of 200px with 0px padding. </div> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console