Help removing the white space | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help removing the white space

Hey there! I'm making my first website and while making it, I'm having an issue. Here's a screenshot of it: https://imgur.com/i9gA4mH I want to know how can I remove the white line between the Page Logo area and the links area where Contact, About Us etc, are there. I've tried many times but I must be doing something wrong so please tell me what can I do to remove the white area... Also, should I include the code? I guess it's not safe to do so.. :/

21st Jun 2023, 9:36 AM
Ayan Chanda
12 Answers
+ 4
The paragraphs or headings are usually displayed with a top and bottom margin by default. By explicitly telling the browser to use margins of 0 (for top and bottom), the gap disappears.
21st Jun 2023, 10:45 AM
Lisa
Lisa - avatar
+ 2
If we cannot see your code, we can only guess. It could be some margin, it could be the layout. Link your code like this: Click +, Insert Code, sort for My Code Bits, select your code.
21st Jun 2023, 9:47 AM
Lisa
Lisa - avatar
+ 2
The + us next to the send icon.
21st Jun 2023, 10:09 AM
Lisa
Lisa - avatar
+ 2
I tried #headerh1, #links { margin: 0 auto; }
21st Jun 2023, 10:41 AM
Lisa
Lisa - avatar
+ 1
The gap seems to come from the top/ bottom margins of h3 and h4.
21st Jun 2023, 10:19 AM
Lisa
Lisa - avatar
0
Well, I still didn't get how to insert it :/ I can't see the + Icon or am I mistaking something? Anyways, here's another screenshot of the code https://imgur.com/T6fcmjU
21st Jun 2023, 10:06 AM
Ayan Chanda
0
I just noticed that we don't have that option on the PC version :/ - Removed the code since I don't need any help with it -
21st Jun 2023, 10:12 AM
Ayan Chanda
0
I wasn't able to fix it, do you have an idea to fix it? Or a hint..
21st Jun 2023, 10:28 AM
Ayan Chanda
0
Thank you so much!!!!!!! But I'd be very glad why this occurred if you explain it. No worries if you do not :)
21st Jun 2023, 10:43 AM
Ayan Chanda
0
padding and margin might be a problem, another problem is, that different browsers display differently. So if the site shows well with one browser, you might still adapt it to the other. I.e. try to change padding and margin so that they are not in the way, and try to make the height of the boxes by percent (hint: usual height is 1080, so you can convert px in percent), then you are safe with all browsers
22nd Jun 2023, 9:40 AM
Antje Beckers
0
Lol I don't get why people are still replying even though it's solved a day ago I should delete this question xd
22nd Jun 2023, 9:42 AM
Ayan Chanda
0
Never mind, this is one of the basic problems in html, so just let it there, others will have the same question
22nd Jun 2023, 9:45 AM
Antje Beckers