CSS Design Issue Advice

Dpinkston91

Solid State Member
Messages
20
Location
Arkansas City, KS
So when I do...

body {
background-color: black;
}

It stretches out on the left side of the page. There is absolutely no margin left.

I'm using...

div {
width: 1358px; (Because I want to style a box at only the top of the page)
}

Which stretches just far enough to the right side of the page not to require a scroll-bar, but it will not cover the white margin on the left-hand side of the page. Any suggestions?
 

Attachments

  • 2021-02-22 (1) (Edited).png
    2021-02-22 (1) (Edited).png
    176 KB · Views: 5
  • 2021-02-22 (2).png
    2021-02-22 (2).png
    110.8 KB · Views: 5

kalju

In Runtime
Messages
300
Location
EU
If you provide the address of this page, you can probably help.
At the moment, it is quite difficult to guess what exactly needs to be changed or added, because there are many possibilities.
But if you only want to change the background of one part of the web page, as in the first image, you certainly can't change the body background color, because this command changes the whole web page background.
 

carnageX

Private Joker,
Staff member
Messages
25,050
Location
Oregon
Open up your browser's Dev Tools (F12) and check to see if you have any inherited styles/classes adding that margin / padding.
 

JoeyStyles

Beta member
Messages
3
Location
Virginia
Chrome inspection is a really useful tool, helps me a lot when I don't know how to fix certain things. And yeah, I'm not here to judge but honestly your website looks pretty bad. Have you tried to use other fonts and styles? I understand that this is just a portfolio and you don't want to waste time on it but still. It would be better if you used some other fonts for your webpage, it would attract people much more. I personally use the services of website designers newcastle nsw who frequently help me to make or edit my own websites.
 
Last edited:

kalju

In Runtime
Messages
300
Location
EU
Don't you happen to know that You can make exactly the design and layout that You like?
Then you don't have to force your taste on others.
Try it, it is good for You.
 

carnageX

Private Joker,
Staff member
Messages
25,050
Location
Oregon
Chrome inspection is a really useful tool, helps me a lot when I don't know how to fix certain things. And yeah, I'm not here to judge but honestly your website looks pretty bad. Have you tried to use other fonts and styles? I understand that this is just a portfolio and you don't want to waste time on it but still. It would be better if you used some other fonts for your webpage, it would attract people much more. I personally use the services of website designers newcastle nsw who frequently help me to make or edit my own websites.
I believe OP is attempting to learn HTML/CSS/JS and this is the exercise he's chosen to give himself a goal.
 
Top Bottom