H1 element look more appealing?

Having trouble making this H1 element look better. An image of what it looks like is below (Red=What I want to modify, Blue=What I want it to look like) Source code is also below

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="The fith (and final) practice webpage for Aidan Hammonds EPQ" />
<link rel="stylesheet" href="Practice Webpage 5.css" />
<link rel="icon" type="image/x-icon" href="favicon(PP5).ico" />
<title> Practice Webpage 5 </title>
</head>
<body id="body1">
<header>
<fieldset id="headset">
<div id="title">
<h1> AI being used in Education </h1>
</div>
<img src="https://tse2.mm.bing.net/th?id=OIP.SPhE7W3OyPECnH5OeC1onQHaDt&pid=Api&P=0&h=220" id="headimg" alt="A sixth form teacher teaching a classroom"/>
</fieldset>
</header>
<fieldset id="navigation">
<nav id="bar"> 
<header> Please choose where you would like to go! </header>
<ul>
<li><a class="nav" href="#Teaching">Teaching</a></li>
<li><a class="nav" href="#Students">Students</a></li>
<li><a class="nav" href="#Education-Entrepreneurs">Education Entrepreneurs</a></li>
</ul>
</nav>
</fieldset>
<body id="Teaching" class="sub">
<h2> Teaching </h2>
<section id="textT">
<div class="1stp"></div>
<div class="2ndp"></div>
<div class="summary"></div>
</section>
</body>
<body id="Students" class="sub">
<h2> Students </h2>
<section id="textS">
<div class="1stp">
</div>
<div class="2ndp"></div>
<div class="summary"></div>
</section>
</body>
<body id="Conclusion" class="sub">
<h2> Conclusion </h2>
</body>
</body>
</html>
*{
	
}
:root{
	
}
#body1{
background-color: black;
}
#bar{
	
}
#title{
padding: 0;
}
h1{
	color: white;
	font-family: droid-serif;
	font-size: 4rem;
	padding: 0;
	row-gap: 3rem;
}
#headimg{
	float: top;
	height: 325px;
	width: 625px;
	padding-left: 700px;
	padding-bottom: none;
}
#headset{
	background-color: black;
	padding: 0;
	border: 400px;
}
.nav p{
	border-bottom: grey;
	list-type: none;
	margin-bottom: 30px;
}
a, li, h2, h3{
	color: white;
}
#navigation{
	border-color: grey;
}
header{
	color: white;
	font-size: 1.7rem;
}
.sub{
	display: grid;
}
.1stp{
	
}
.2ndp{
	
}

Hello aidanhammond382!

It looks as though you need to target the title id, or the h1 element, with the font you would like to apply. You will need to tell your code where to find that font (i.e. Google, &c) with an import statement in your css or in the head section of your HTML.

Does this help?

Happy Coding! :slightly_smiling_face:

Thank you for responding. I am not trying to change the font, I am trying to find a way to make the h1 element fit like it does in my image (blue writing). I like droid-serif for a font. Thank you :slightly_smiling_face:

Ah, so you want the h1 text to be in-line with the photo?

I believe so, I would also like the top gap of the page to be gone as nothing is filling it, making it look unproffessional

Text Wrap Around Images
Text wrapping is the practice of surrounding a picture or diagram with text. Including images in your text is an excellent way to display essential information.

Ok. To remove the gap at the top, you could add a rule to your * { } selector as follows:
margin: 0;
With regard to the adding the text and the image to occupy the same horizontal “line”, you could use a flex approach something to appear like this.


To see how I acheive this result, I created a codepen for you to review and play with.

Check it out.

Does this help?

Happy coding! :slightly_smiling_face:

This has helped me so much, thank you!

If you want to control the line breaks you can always use the <br> element.

<h1>AI<br>being used<br>in<br>Education</h1>

Very glad to have helped. Check out my other codepens which also treat some other layout techniques.

Happy Coding! :slightly_smiling_face:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.