Couple of questions, firstly I have been creating my tribute page within a normal code editor, so when I do get round to putting it in CodePen, do I have to link the relevant images or is there a way to upload them? Secondly, I just wanted to know if there is any way to have the background color of, say, a heading and a paragraph, both line up at each side? It’s hard to explain, so here’s an example (ignore the lorem!):
I don’t know if this is going to be tl;dr, but here is the code thus far (can remove and host elsewhere if necessary!)
HTML
<!DOCTYPE html>
<html>
<head>
<title>A Tribute to Sir Terry Pratchett</title>
<meta content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<main id-"main">
<div class="container">
<h1 id="title">A Tribute to Sir Terry Pratchett</h1>
</div>
<img id="bee" src="bee.png" alt="Mind How You Go" title="GNU Terry Pratchett">
<div id="img-div">
<img id="image" src="PTerry.png" alt="A photo of Sir Terry Pratchett" title="A photo of Sir Terry Pratchett">
<figcaption id="img-caption"><i>Terry Pratchett, in his trademark black fedora.</i>
</figcaption>
</div>
<section id="tribute-info">
<h3 id="para1">Sir Terry Pratchett, OBE</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque malesuada orci a enim aliquam dictum. Duis rhoncus sit amet libero tristique auctor. Pellentesque at tortor sit amet ex vehicula aliquam sit amet ac est. Mauris sollicitudin, diam vitae mattis vestibulum, magna eros dignissim diam, sed venenatis libero tellus ut ipsum. Aenean aliquet diam in arcu condimentum, eu porta nisi suscipit. Cras massa tortor, congue ut ex non, convallis congue dui. Suspendisse rhoncus a turpis commodo tincidunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ultricies quis metus sed pulvinar. Morbi elementum diam aliquam lacus hendrerit, sed bibendum augue tristique. Integer cursus sem sit amet elit interdum, ac porta nisi dictum. Aenean efficitur porttitor nulla, eu volutpat velit sodales sollicitudin. Curabitur posuere eros vel ornare venenatis. Donec bibendum sollicitudin fringilla. Donec turpis eros, consequat id faucibus sed, vulputate nec dolor. Interdum et malesuada fames ac ante ipsum primis in faucibus.
</p>
<h3 id="para2">The Discworld Series</h3>
<p>
In non mattis lorem. Aliquam dolor velit, porttitor in neque ac, laoreet convallis dui. Cras vehicula laoreet leo, a placerat mi interdum sit amet. Aenean vulputate tempor erat a scelerisque. Quisque blandit varius ex in vehicula. Nunc aliquam neque nisl, a elementum leo dapibus non. Donec scelerisque quis leo at porttitor. Sed in ante pretium, fermentum dui eu, interdum elit. Nulla facilisi. Curabitur ut eros erat.
</p>
</section>
<section id="further-info">
<h3 id="para3">Further Information</h3>
<p>
If you would like to learn more, then visit <a id="tribute-link" href="https://www.terrypratchettbooks.com/about-sir-terry/" target="_blank">this link.</a>
</p>
</section>
</main>
</body>
</html>
CSS
body {
background-color: rgb(145, 168, 190);
}
h1 {
color: #FAFAFA;
background-color: rgba(0, 0, 0, 0.25);
text-align: center;
padding: 10px;
margin-left: 5px;
font-family: 'Raleway', sans-serif;
}
#bee {
position:absolute;
left:0;
top:0;
max-width: 10%;
border-radius: 50%;
}
#image {
border: 3px solid #FAFAFA;
border-radius: 50%;
padding: 10px;
position: relative;
background-color: rgba(200, 162, 200, 0.5);
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
max-width: 30%;
height: auto;
}
#img-caption {
color: #FAFAFA;
text-align: center;
background-color: rgba(0, 0, 0, 0.25);
margin: auto;
}
h3 {
text-align: center;
background-color: rgba(0, 0, 0, 0.25);
padding-top: 5px;
padding-bottom: 5px;
font-family: 'Raleway', sans-serif;
}
#tribute-info {
color: #FAFAFA;
text-align: justify;
background-color: rgba(0, 0, 0, 0.25);
padding: 10px;
padding-top: 0px;
}
#further-info {
color: #FAFAFA;
background-color: rgba(0, 0, 0, 0.25);
padding: 10px;
padding-top: 0px;
text-align: center;
}
a:link {
color: rgb(200, 162, 200);
}
a:visited {
color: rgba(200, 162, 200, 0.5)
}
a:hover {
color: rgba(200, 162, 200, 0.5)
}
a:active {
color: rgb(200, 162, 200);
}
Sorry for the mess, I’ll be really grateful if someone can help! A lot of it I’ve picked up from cobbling together code from half a dozen sources, like some sort of web-development Frankenstein. Any superfluous or offensive code, please tell me!