CSS not loading

Hi,
I have not looked at the tutorial, but you can’t say that using margins on a ul or ol is incorrect.

It all just depends on what you need to accomplish. Margin creates space on the outside of an element and padding creates space on the inside. You use them at your discretion and according to what you need.

There’s been many of times I’ve used margins and paddings with a ul.

As ronpat mentioned above, browsers set their own defaults so you need to be aware of that. You have the ability to override browser defaults and change things as you wish.

1 Like

Some browsers, many years ago, assigned margin-left to uls for indentations by default. Others assigned padding-left. The dust settled on that competition long ago. I’ve not seen a browser assign margin-left for indentations in 10+ years.

However, I DID say that lists automatically assign vertical margins by default - margin-top and margin-bottom - like paragraphs. So it is not correct to jump to the conclusion that all margins on lists are wrong. You need to read the information that you are studying or being given here very carefully. Don’t “cherry-pick” and read only what you wish. Coding with HTML and CSS is not the same as using JavaScript plug-ins. One cannot simply copy and paste HTML and CSS from another web page into your new page and expect it to work the same. It probably won’t.

By association with that margin-left and a few other conventions, I believe that the tutorial that you are using is way out of date… way old. I recommend that you sign up for a reputable modern HTML and CSS course either on-line or at a community college. Take the entire class without cherry-picking. It will be the best investment you can make in yourself as far as web development is concerned.

1 Like

This is strange because now it is displaying the correctly and I didn’t change anything… maybe it was stucked in caching or something…

Glad to see that you found your code working as you expected.

Do you intend to find out why the CSS loads so slow? I did suggest several questions you could explore.

My apologies… I haven’t read it yet but will have a look when I have the time… Cheers!

1 Like

It is also more usual to declare the font-family for the body, and let other elements inherit it from there, or override it where a change of font is required. Without a font set for the page, visitors will see whatever font is set as default in their browser, which may differ markedly from your intention. At the moment, only ul li a has a font declaration.

1 Like

I took a look at the tutorial link in this topic, to get an idea of what the OP is learning. They have mentioned mmtuts in several topics (in PHP also) where the code seems to be out-dated and poorly constructed.
This particular tutorial was published in November 2017, which is not so long ago. But the css code they teach in is not great. There are font sizes in px, line height in px, fixed heights for elements, not the best.
I have not watched any of their PHP tutorials (I don’t really have time to sit though them), but the code in those topics suggests they are similarly out-dated and poor, which may be cause for concern.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.