Hi, Everyone, Today i am working on the fallowing requirements at my current webpage:
The body should have padding and margin
The header should have a background color, background image (using a local image), and padding
The navigation links (and only the links in the navigation) should be styled with a new display, margin, border-radius, text-decoration, and padding
The link to the current page should be styled differently from the other links (using class = "active’)
The sections should be next to each other, not one on top of the other.
The images should be part of the page now. In addition, they should have a border, be centered horizontally, and have vertical (top/bottom) space between them and the other images. I almost done most of the requirement above but my problem as you can see that my layout not fitting my webpage. would anyone help me with explanation please
Actually, I had the same thing with my website. Even now my logo is does not fit the whole layot when you look at it through very wide screens.
In your case, I would definitely hire a good developer for 5$ on Fiverr, who could fix this issue in a matter of a few minutes.
The problem is in how you have structured the layout.
You have the aside, a block element which will default to full-screen width (auto), then you size the pictures within it.
But that does not make the aside any smaller than the default full width.
As a consequence, the following element that you want to the side has no space to the side. As another block element it will naturally sit below, also being a default full width. You then force the full width element up next to the other full width element with a negative margin.
So you now have two full width elements next to one another, overlapping a bit. Something has to give, two screen width blocks won’t fit on one screen side by side, even with an overlap.
The solution is to think more carefully about structuring the layout and looking ahead.
There are many methods to put content side by side, float, display table, grid, flex.
In this case I think display table may fit he bill.
The short answer is the inappropriate negative margin applied to the section element:
section {
margin: -65%;
}
I would like to recommend that you take a formal or structured HTML/CSS course that teaches the basics in a building block manner rather than haphazardly. You need to understand how to structure a page.
Hi ronpat, I started my html at the middle of October or after by couple days with coursera, (introduction to html) and now am still learning Css3 (introduction to css3) with coursera as well, still am learning the basic/foundation of css3
Thank you a lot for your help, i really appreciate that. I would like to ask you too. Is there any possibility or another way for achieving the work you have done without touching or changing in the HTML code? or still i will have the same result i have achieved?
Hi @coothead I understand what you saying, I can not change the HTML code, because the teacher of the curriculum asked us to apply the selectors that we have studied and without using any new selectors that we didn’t cover yet.
I understand also that if i do some change in the HTML Code that provide by the instructor the result will be better than what i have achieved
As we don’t know what selectors you have learned yet it becomes difficult for us to provide specific answers other than to say when you are doing something wrong
Bearing in mind that this seems to be part of your coursework then it would be wrong of us to provide fully formed solutions anyway as you really need to get there on your own steam.
We can of course tell you where you are going wrong or what you should be doing but a big part of learning is working out things for yourself because that’s where most progress is made.
Hi Paul,
Thank you for your reply, Totally agree with what you said. I would like to ask if this community for people who are still studying or for the professional only?
It’s very definitely for everybody. (Hopefully we are all still learning one way or another, too. )
If you have a question about your coursework, then it’s best to be clear at the beginning firstly that it is coursework, and also if there are any specific requirements. (For example, that you must leave the HTML unchanged.) That way, you’re likely to get helpful responses tailored to your situation, rather than people offering you alternative methods which you are not allowed to use.
From my past experience, it’s a nice mix. We have a lot of people who are still students or attempting to learn still. And on the other side, we have the experienced professionals who answer those questions. And a lot of times, the professionals ask questions too! As @TechnoBear said, we have a nice mix .
You are great and you inspired me by what you said, Thank you a lot for your help yesterday, hopefully one day i will do the same to someone else and be an inspirational too