+ 1

why is there some space at top when I put <p> tag ?

<!DOCTYPE html> <html> <head> <title>Transition</title> <style type="text/css"> div{ color:green; font-size:30px; height:150px; width:150px; font-family:Times New Roman; } </style> </head> <body> <div><p>Hello<p></div> </body> </html>

3rd Jan 2022, 5:32 AM
kushal
1 Answer
+ 5
*{ margin:0; padding:0; } Add this if u want to remove that space That space is because every browser has its own default ‘user agent’ stylesheet, that it uses to make unstyled websites appear more legible You can learn more about this from here https://cssdeck.com/blog/what-is-a-css-reset/
3rd Jan 2022, 6:01 AM
Atul
Atul - avatar