My website (<yourname>.github.io>
) looks like this, and nothing like my HTML/CSS.
Chances are you just need to rename your main webpage. Remember, your browser will look for an index.html
file when displaying your website. If you don't have an index.html
, you need one! An easy way to rename a file in the command line is using the mv
command, which we'd conventionally use to move a file or directory. In this case, all you need to do is cd
into the directory containing your HTML, CSS, and/or JS files, and enter the following (without angle brackets):
mv <old_file_name> <new_file_name>
including file extension. For example,
mv neils_awesome_webpage.html index.html
That's it!
Ensure
Remember our center alignment hack:
.element {
margin: 0 auto;
}
This continues to be difficult, but I strongly recommend this method:
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}