How to add CSS to an HTML and link webpages for a menu bar


#1

I am new to coding and am attempting to teach my self. I created a menu bar using html but I can’t get it to center using html. I also want to link the webpages to the menu bar so that it actually function but I can’t get it to function like a button.

Like I said, I’m really new to this so any general information would be helpful.


#2

You mean Atom API or pure HTML/CSS?


#3

Pure html/css. I started working on this in notepad and then found Atom.


#4

We would be better able to help you if you posted the code you were working on. Without knowing specifics, I can’t give specifics, so I have to give generalities.

It’s generally unwise to mix structure and styling in the same document. If you look at how most modern sites are designed, you will find the fact that the menu bar exists defined in the .html file, but all of the qualities of its existence are defined in the .css file.

HTML:

<navbar>
<ol>
  <li>Home</li>
  <li>Portfolio</li>
  <li>About</li>
</ol>
</navbar>

CSS:

navbar {
  width: 600px;
  margin: auto;
}

I don’t understand what you mean by this. In your words, how does a button work and how is it different from a hyperlink?

P.S. General HTML and CSS help is beyond the scope of this forum and it definitely doesn’t fall under the Support category (which is about Atom issues), so I wouldn’t be surprised if this thread gets moderated.