Skip to content

Instantly share code, notes, and snippets.

View joabj's full-sized avatar

Joab Jackson joabj

View GitHub Profile
@joabj
joabj / Div-Define.css
Created December 14, 2025 00:44
From the Tutorial "Center a Div"
/*Inserted into the header file of an HTML document*/
<head>
<style>
div {
display: block;
}
</style>
</head>
@joabj
joabj / Div-Class.html
Last active December 14, 2025 02:15
From the Tutorial "Center a Div"
<html>
<head>
<style>
.red-text {background-color:red}
</style>
</head>
<body>
<div class="red-text">"Soul Kitchen"</div>
@joabj
joabj / Div-ID.html
Created December 14, 2025 02:21
How the ID attribute of Div works. From the Tutorial "Center a Div"
<html>
<head>
<style>
#red-background {background-color:red}
</style>
</head>
<body>
<div id="red-background">"Moonlight Drive"</div>
@joabj
joabj / CSS-Center.html
Last active December 14, 2025 03:43
From the tutorial "How to Center a Div"
<html>
<head>
<style>
.container {width: 50%; /*Sets the size of the conatiner as a percentage of overall page */
margin: 0 auto; /*Margin above and below the content text set to 0; and left/right margin is claculate dby the browser*/
}
</style>
</head>
@joabj
joabj / Two-Column-Div.html
Created December 14, 2025 04:14
From the tutorial "Center a Div"
<html>
<head>
<link rel="stylesheet" href="styles.css">
<style>
.container {width: 90%;}
.left {
width: 44%;
float: left;