Simple question

Why is it possible to set a left margin, but not a right one? Why should this command/code be so difficult? I want to center my text on my site, and it is difficult to do (at least to me).

I am a neophyte, and have only been working with HTML/CSS for about a year. I find it amazing that the powers to be can make the process so difficult. There seems to be an effort to keep changing things so that the
newcomer has to constantly change his way of thinking.

I know the ole saying that “the only thing constant is change” but I often wonder if the folks who manage all this just want to keep their elite status.
Okay, now shoot me down.

That’s simply not the case. They work both the same.

You just need to take a bit of time to learn this stuff properly, preferably with a good book. The basics of CSS (including margins) are very simple. So show us a bit of code and we can show you what to do.

If you are trying to center a div, you can just set a width on it and use a simple rule like

margin: 0 auto;

The 0 means zero top and bottom margin, and “auto” left and right margin, which centers the element inside its parent element.

I know the ole saying that “the only thing constant is change” but I often wonder if the folks who manage all this just want to keep their elite status.

That’s quite simple, and has not changed in over a decade. These are not shifting sands! :wink:

It is only the marketers that that want you believe the sand has shifted like Ralph said essentially CSS and HTML haven’t really changed for over a decade. It’s more a case of the browsers and hacks have instead.

welcome to the web development world. :slight_smile: As with technology web development is constantly evolving.

Personally I don’t think things change so much as improvements are being made.

Once you understand the basics and have a thorough knowledge of what’s going on you will see the light.

Just do not want the text running to edge of page on most of my site. Would like decent margins left and right.

CSS to use in an external stylesheet to provide a gap of 20px at each side of all your pages.

body {padding-left:20px;padding-right:20px;}

Or a gap of 20px on all sides

body {padding:20px;}

Or 20px sides, 0 top and bottom

body {padding:0 20px}

Pages that are exceptions to the rule can have a class added to the body element. For example:

.something {padding:20px 0;}

Would leave no gap at the sides and 20px top and bottom. The body element for these pages would be

<body class="something">

Your home page uses an external stylesheet but other pages have embedded stylesheets. Are you planning to rework the entire site?

It’s good that your site focuses on content rather than eye candy, but the code is in sore need of straightening out. People prepared to help with specific problems expect there to be a baseline standard that the helpee is targeting, otherwise it’s like troubleshooting a metal detector made of bean cans and tooth fillings. :slight_smile: The builder’s ambition is admirable, but the best solution is to use the right components and follow a blueprint.

External AND internal – with so much internal CSS it begs the question what is that external file even doing?

I do not know how to do an external stylesheet any longer. Not an excuse, but at 70 it’s all I can do to keep up with what I do know. Hell I can’t remember what I had for breakfast!

You already have one. :wink: There’s a link to it in the head:

<link rel=“stylesheet” href=“styles.css” type=“text/css”/>

So all you need to do is paste your styles into that styles.css file.

EDIT:

Ah, I see that link is just on the home page. Assuming all your pages are in the root folder (as they seem to be) you could place that same link in the head of each page and the styles in that one file will apply to each of your pages.

Which is one of the reasons to use CSS – so you can say the styling of things that are going to be the same on every page (like the menu) just ONCE in one file, and have it pick up on all the pages. Makes it easier to maintain (less code), easier to make sweeping re-stylings (since you only edit it in one place and every page picks it up), and even saves bandwidth and speeds loading of sub-pages since you are basically pre-caching the appearance of your sub-pages.

I’m only 40, but I know what you mean – medication induced stroke backed by some nice parkinsonisms thanks to some quackery – so my short-term memory is a bit wonky.

Off Topic:

I was born with faulty short-term memory so when I get older I suspect, I’ll be really bad or at least used to the problem with having it all my life.

Well, keep trying you may retain some of the information maybe you should write yourself notes; that ‘external style sheets’ are good and internal are bad and print out some code snippets.