I have Sasha Vodnik HTML5 and CSS3 book and I'm trying to create bullet points for my unordered lists. Now I have literally tried a good 15+ variations to the ul styling rules and selectors/declarations. I've tried putting article ul{} instead of ul{}, I have tried using display in the <article> display: list-item; </article> I've also tried changing the color, position, and everything I could think of. Why are the bullets not displaying? Apologies if it's blatently obvious, I'm still trying to learn CSS style and order of precedence. I can not really find anything on what order you should put your style rules especially in the book, so I'm trying to put it in the order of the html document. Thank you for any insight you can share. Also when I try to set the reset styles it collapses & condenses my whole document. Does this mean if I do not set the border, margin, and padding for each of these, that it will be set to 0?
html {
font-size: 12px;
}
h1, h2, h3 {
font-family: 'Bree Serif', serif;
}
.container {
max-width: 700px;
margin: 0 auto;
border: 2px solid black;
}
header {
text-align: center;
padding: .4em;
}
h1 {
color: #EADCDC;
background-color: darkgrey;
font-size: 5em;
text-shadow:2px -2px 4px black;
}
body {
background-color: #dee9f9;
font-family: Tahoma, Arial, Helvetica, sans-serif;
}
h2 {
color: slategray;
font-size: 3em;
}
article {
background-color: ivory;
padding: 3%;
}
h3 {
color: teal;
font-size: 2em;
}
/* paragraph elements */
p {
font-size: 1.2em;
line-height: 1.4em;
}
.accent {
text-decoration: underline;
text-align: center;
}
ul {
list-style: disc;
list-style-position: outside;
font-size: 1.2em;
line-height: 1.4em;
}
aside {
color: rgb(189, 204, 212);
background-color: #EADCDC;
width: 45%;
padding: 2%;
margin: 2%;
box-shadow: 3px 3px 3px black;
border-radius: 30px;
float: right;
}
footer {
padding: 0.6em;
color: ivory;
background-color: darkgrey;
text-align: center;
}
footer p {
margin: .4em;
}
<div class="container">
<header>
<h1>Campus Band Battle</h1>
</header>
<aside>
<h2 class="accent"> ALL AGES EVENT</h2>
<h3>WHEN</h3>
<p>June 8th</p>
<p>8 pm-12pm</p>
<h3>WHERE</h3>
<p>Student Union Auditorium</p>
<p>1234 Learning circle, Sunshine, NV</p>
<p>Featuring Band XYZ, Band ABCD</p>
</aside>
<article>
<h3>Advance Tickets</h3>
<p>$18 General</p>
<p>$36 VIP</p>
<p>Group rates available on site</p>
<h3>SPONSORS</h3>
<ul>
<li>Adventure Works</li>
<li>Charleston Ski House</li>
<li>Contoso Ltd.</li>
<li>Fifth Coffee</li>
<li>Trotter's Travel</li>
<li>School of Fine Art</li>
<li>The Phone Company</li>
</ul>
<h3>BENEFITTING</h3>
<p>The School of Music</p>
<p>Arts and Entertainment Council</p>
</article>
<footer>
<p> www.123BandBattle.org</p>
</footer>
</div>
1.Hi it's look like ul is display correctly, a small bullets at the beginning of every list-item (li) is the natural behavior of unordered list.
2.some elements have default padding/margin, if you set them to 0 the elements won't have extra space around them.
Related
The footer at the bottom shifts to the right in desktop viewport but not in a smaller viewport. My goal is align it at the center for all viewports. I think the problem lies in the footer rule in the CSS file but i'm not sure.
I've included screenshots of how the codes look like in desktop viewport and also mobile viewport.
#container {
width: 100%;
margin-left: auto;
margin-right: auto;
}
body {
background-color: black;
font-family: "times new roman", calibri, cursive;
font-size: 1em;
color: white;
}
.equip {
float: left;
padding-right: 0em;
padding-top: 0em;
margin-right: 3em;
box-shadow: 1em 1em 2em powderblue;
}
h1 {
padding-left: 30px;
font-family: cursive, "times new roman";
}
h2 {
margin-bottom: 130px;
padding-left: 30px;
font-family: "times new roman", cursive, calibri;
}
nav a {
clear: both;
margin-left: 100px;
text-align: center;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
color: black;
background-color: white;
border-radius: 15px;
}
main {
display: block;
clear: both;
margin-top: 100px;
background-color: powderblue;
margin-right: 100px;
margin-left: 80px;
border-radius: 30px;
box-shadow: 5px 8px 10px white;
max-width: 890px;
}
p {
padding-top: 20px;
margin-left: 100px;
color: black;
font-weight: bold;
}
ul li {
color: black;
list-style-type: none;
margin-left: 130px;
}
footer {
display: block;
text-align: center;
font-size: 0.8em;
}
<body>
<div id="container">
<p><img class="equip" src="images/Home Image1.jpg" alt="Durango Jewelry" width="260" height="195" title="Durango Jewelry"></p>
<header>
<h1>Durango Jewelry and Gem Shop</h1> <br>
<h2>Distinguished wire-wrapped jewelry,pendants, and gems</h2>
</header>
<nav>
Home  
Classics  
Specials  
Gems  
Contact Me  
</nav>
<main>
<p>Durango Jewelry and Gem Shop pampers you with one-of-a-kind, high quality wire-wrapped pendants and gems. Our works of art are inspired by natural<br> geometries and the vast beauty of mother nature.<br></p>
<p>The featured pendant provides these characteristics :<br><br>
<ul>
<li> <span style="color:red;">"Smoky Quartz"</span> gemstones, also called <span style="color:red;">"Soulmate Crystal"</span> </li>
<li> gemstone is over 2 carats </li>
<li> high quality silver alloy requires very little polishing </li>
</ul><br>
</p>
<p>Come over to our store !</p>
</main>
<footer>
<p style="color: white;font-size:0.8em;">Durango Jewelry Shop, <br> 101001 Main Street, <br> Durango CO |Established 1979 <br>
<a style="color:powderblue" href="mailto:template.t#mailserver.com">Click Here to E-mail Us </a>
</p>
</footer>
</div>
</body>
Desktop viewport
iPhone 4 viewport
by removing margin-left: 100px; in css of p tag it works
p
{
padding-top: 20px;
color: black;
font-weight: bold;
}
I have seen you code and found that your main section in not come in center your footer is already in center.
Because you have apply some left and right to the main section it is restrict to come in center, kindly replace you css with my suggested css and your issue will resolve.
Suggested css
main {
background-color: powderblue;
border-radius: 30px;
box-shadow: 5px 8px 10px white;
max-width: 890px;
margin: 0 auto;
top: 20px;
position: relative;
}
Inside <footer> you have a <p> tag. And in your CSS you have p { margin-left: 100px }.
I am trying to float my aside element to the right of my main element and for some reason it is too large. I specified the width of the main as 60% and the aside as 39% (because the body element is 99%) but somehow this ratio is just not displayed correctly.
Here is the html and css:
* {
margin: 0;
padding: 0;
}
html {
background: url("/images/sheetmusic.gif") repeat 0 0;
background-size: 30%;
background-attachment: fixed;
background-position: center;
}
body {
font-family: arial, Helvetica, sans-serif;
font-size: 100%;
width: 99%;
max-width: 800px;
margin: 0 auto;
background-color: rgba(255, 248, 228, 0.95);
border: 2px solid #585858;
}
a:link {
color: #e07400;
}
a:visited {
color: gray;
}
a:hover,
a:focus {
font-style: italic;
}
/*====================HEADER========================*/
header img {
float: left;
width: 100%;
max-width: 136.078px;
}
.orange_header {
color: #e07400;
}
header h1 {
margin: 0 auto;
font-size: 200%;
text-shadow: 2px 1px 1px black;
padding-top: 0.7em;
padding-bottom: 0.5em;
}
/*====================NAV MENU========================*/
#nav_menu a {
margin: 0;
border-right: 1px solid silver;
}
#nav_menu a.current {
color: white;
display: block;
background-color: #a78349;
}
#nav_menu ul {
list-style-type: none;
margin: 0;
padding: 0;
position: relative;
height: 34px;
}
#nav_menu>ul>li {
float: left;
width: 20.748125%;
/* 165.985/800*100 */
}
#nav_menu ul li a {
display: block;
text-align: center;
text-decoration: none;
padding: 0.5em 0;
margin: 0;
background-color: #ab6b06;
color: white;
}
#nav_menu ul ul {
display: none;
position: absolute;
top: 100%;
}
#nav_menu ul ul li {
float: none;
}
#nav_menu ul li:hover>ul {
display: block
}
#nav_menu>ul::after {
content: "";
clear: both;
display: block;
}
#lastmenuitem {
border: none;
}
/*====================MAIN========================*/
main {
display: block;
position: relative;
width: 60%;
}
main h2 {
font-size: 150%;
padding-top: 0.5em;
padding-bottom: 0.2em;
padding-left: 1em;
}
strong {
color: #ab6b06;
}
main p {
font-size: 100%;
padding-left: 1.5em;
padding-right: .5em;
padding-bottom: 1em;
}
main ul,
ol {
padding-left: 3em;
padding-right: .5em;
padding-bottom: 1em;
line-height: 1.2em;
}
/*=============ASIDE====================*/
aside {
display: block;
float: right;
width: 39%;
margin-top: 1em;
border-left: 2px solid #ab6b06;
}
aside h3 {
font-size: 120%;
margin-left: 1em;
margin-bottom: 0.2em;
}
aside>p {
padding: 0;
margin-left: 1em;
margin-right: .5em;
word-wrap: break-word;
}
#sittingpic {
padding-left: 2em;
}
blockquote {
margin-left: 1em;
margin-right: .5em;
margin-bottom: 1em;
text-indent: 0;
}
.image {
position: relative;
border: 1px solid #333;
margin: 2%;
margin-left: 1em;
}
.image img {
width: 70%;
max-width: 150px;
}
iframe {
padding-left: 2em;
width: 90%;
max-width: 720px;
}
/*====================FOOTER========================*/
footer {
background-color: #ab6b06;
font-family: georgia, serif;
font-size: 90%;
text-align: center;
}
<html lang="en">
<head>
<meta charset="utf-8">
<title>Annemie's Guitar School | Learn Classical Guitar</title>
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/main.css">
</head>
<body>
<header>
<img src="images/guitarlogo2.png" alt="Guitar" height="109.93">
<h1 class="orange_header">Annemie's Guitar School</h1>
</header>
<nav id="nav_menu">
<ul>
<li>Home</li>
<li>Useful links</li>
<li>Lessons
<ul>
<li>Sitting position</li>
<li>Reading music</li>
<li>Right Hand Technique</li>
<li>Left Hand Technique</li>
<li>Practising and Memorization</li>
</ul>
</li>
<li>Bio</li>
</ul>
</nav>
<main>
<aside>
<h3>History of the guitar</h3>
<p>In this documentary, Julian Bream walks you through the history of the classical guitar in Spain. He plays pieces that are relevant to the different eras of the guitar. Although the documentary is fairly slow paced - it is worth the watch! <br>
Watch video
</p>
<h3>Anatomy of the guitar</h3>
<img src="images/clas-diagram.jpg" alt="Guitar Diagram" class="image" height="300">
<h3>Quote of the day</h3>
<blockquote>“Sometimes you want to give up the guitar, you’ll hate the guitar. But if you stick with it, you’re gonna be rewarded” ~<cite> Jimi Hendrix</cite></blockquote>
</aside>
<h2 class="orange_header">Classical Guitar</h2>
<p>The guitar is arguably the most popular and versatile instrument in the world. It is used in a variety of different musical styles like rock, blues, folk and pop. <strong>This school focusses on the classical style of playing. </strong> With classical
guitar you use nylon strings and play all the voices (bass, alto, soprano) using a special right hand technique. The guitar becomes a “mini orchestra”.</p>
<h2 class="orange_header">Before you start...</h2>
<p>This school requires you to know a few basics before you can start the lessons. <br>We assume that you can:</p>
<ul>
<li>Tune your guitar</li>
<li>Play chords comfortably</li>
<li>Read tablature</li>
</ul>
<p>If you can‘t do these things - do not worry!<br> We suggest you make use of the “Useful links” page to teach yourself the basics of guitar.</p>
<h2 class="orange_header">The Lessons</h2>
<ol>
<li>Sitting position</li>
<li>Reading music</li>
<li>Right Hand Technique</li>
<li>Left Hand Technique</li>
<li>Practising and Memorization</li>
</ol>
<h2 class="orange_header">About Annemie</h2>
<p>Find out more about the author of this site by going to the Bio page.</p>
</main>
<footer>
<p>©2017, Annemie's Guitar School</p>
</footer>
</body>
</html>
I think you misunderstood the concept of widths. You set the width of main to 60%. This will cover only the 60% of the body tag. You also set the width of aside to 39%, but this element is parent to main. That means that it will cover the 39% of the main container. I don't know if I understood your question (I don't have the reputation right now to ask for more details with comments) so I consider you want something like the following (excuse my bad drawing skills):
click to see the image
I propose to make the following changes:
First create a new div element (I named it main-content) and add the left floating content inside it.
<main>
<aside>
<h3>History of the guitar</h3>
<p>In this documentary, Julian Bream walks you through the history of the classical guitar in Spain. He plays pieces that are relevant to the different eras of the guitar. Although the documentary is fairly slow paced - it is worth the watch! <br>
Watch video
</p>
<h3>Anatomy of the guitar</h3>
<img src="images/clas-diagram.jpg" alt="Guitar Diagram" class="image" height="300">
<h3>Quote of the day</h3>
<blockquote>“Sometimes you want to give up the guitar, you’ll hate the guitar. But if you stick with it, you’re gonna be rewarded” ~<cite> Jimi Hendrix</cite></blockquote>
</aside>
<!-- the newly created div -->
<div id="main-content">
<h2 class="orange_header">Classical Guitar</h2>
<p>The guitar is arguably the most popular and versatile instrument in the world. It is used in a variety of different musical styles like rock, blues, folk and pop. <strong>This school focusses on the classical style of playing. </strong> With classical
guitar you use nylon strings and play all the voices (bass, alto, soprano) using a special right hand technique. The guitar becomes a “mini orchestra”.</p>
<h2 class="orange_header">Before you start...</h2>
<p>This school requires you to know a few basics before you can start the lessons. <br>We assume that you can:</p>
<ul>
<li>Tune your guitar</li>
<li>Play chords comfortably</li>
<li>Read tablature</li>
</ul>
<p>If you can‘t do these things - do not worry!<br> We suggest you make use of the “Useful links” page to teach yourself the basics of guitar.</p>
<h2 class="orange_header">The Lessons</h2>
<ol>
<li>Sitting position</li>
<li>Reading music</li>
<li>Right Hand Technique</li>
<li>Left Hand Technique</li>
<li>Practising and Memorization</li>
</ol>
<h2 class="orange_header">About Annemie</h2>
<p>Find out more about the author of this site by going to the Bio page.</p>
</div>
<!-- new div ends here -->
</main>
Then change your css style to this:
/* we removed the width property to cover the whole page. */
main {
display: block;
position: relative;
}
aside {
display: block;
float: right;
width: 40%; /* this was changed */
margin-top: 1em;
border-left: 2px solid #ab6b06;
}
#main-content {
width: 60%;
}
I have a CSS greybox: (When I say greybox, I mean the CSS box I have created that I have made with the color grey as you can see down below.)
.navigation-div
{
margin-top: 14px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.47);
padding: 0;
color: #E3E3E3;
background-color: #333;
}
This greybox is inside of my header and since this greybox is bigger than it appears, it goes past the header image but doesn't appear.
With this:
<div class="navigation-bar">
<a class="navigation-div-blur">
<div class="navigation-div">
<nav class="navigation">
<img id="mailpicture" src="images/gmail.png">
<h1 id="mailtext">Mail Us</h1>
<h1 id="nava">test</h1>
</nav>
</div>
</a>
</div>
The picture and Mail Us show in the correct position not exposing the box. The test however, when I put it in exposes the box.
Here is the CSS I have behind this
#mailtext
{
margin-top: 20px;
display: inline-block;
margin-left: 1230px;
font-size: 20px;
color: white;
font-style: italic;
}
#mailpicture
{
display: inline-block;
margin-top: 16px;
float: right;
}
#nava
{
font-size: 20px;
color: white;
font-weight: bold;
font-style: italic;
margin-top: 20px;
display: inline-block;
margin-left: 500px;
}
You already saw the box for CSS.
I would like to accomplish either one of two things: Make the CSS box smaller and lower it, or have the CSS correctly position the test along with more elements to stay in the same line as the Mail Us.
NOTE: I have tried for the test margin-top:-pixels, this does not go up high enough and stops going up after a while.
This is what it looks like with the test:
This is what it looks like without the test:
As you can notice the first one has a larger box that drops down beneath the header picture. The one without the test has stayed in the header's picture.
There are a few problems with your code.
First, you should not nest anchors (<a>) in other anchor elements.
Using margin to position elements is not a good idea, you are already trying to use inline-block to change default block display of headers and at the same time you are floating one of your inline-block elements to the right.
Adding big margin to the element makes the element use more space and moves next inline element to the new line if it cannot fit in one line with other elements.
If you want to position all your menu items to the right you can use text- align:right on your inline-block elements to stick them to the right.
If you want your mail element be on the right you may stick to using float:right on it, but it would also be easier to just place mail element as the last one in the nav
You can nest anchors <a> inside headers <h1> to create links inside headers
<h1 id="mailtext">Mail Us <img id="mailpicture" src="images/gmail.png"></h1>
http://jsbin.com/kazocekoba/1/
.navigation-div
{
margin-top: 14px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.47);
padding: 0;
color: #E3E3E3;
background-color: #333;
text-align: right;
}
#mailtext
{
margin-top: 20px;
display: inline-block;
/* margin-left: 1230px;*/
font-size: 20px;
color: white;
font-style: italic;
}
#mailpicture
{
display: inline-block;
margin-top: 16px;
float: right;
}
#nava
{
font-size: 20px;
color: white;
font-weight: bold;
font-style: italic;
margin-top: 20px;
display: inline-block;
/*margin-left: 500px;*/
}
/* use padding to separate your navigation elements */
.navigation > * {
padding-left: 2em;
}
<div class="navigation-bar">
<a class="navigation-div-blur">
<div class="navigation-div">
<nav class="navigation">
<!-- --><img id="mailpicture" src="images/gmail.png">
<h1 id="mailtext">Mail Us</h1>
<h1 id="nava">test</h1>
</nav>
</div>
</a>
</div>
A bit better solution http://jsbin.com/xunokaviju/1/
.navigation-div
{
margin-top: 14px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.47);
padding: 0;
color: #E3E3E3;
background-color: #333;
text-align: right;
}
#mailtext
{
margin-top: 20px;
display: inline-block;
/* margin-left: 1230px;*/
font-size: 20px;
color: white;
font-style: italic;
}
#mailpicture
{
display: inline-block;
margin-top: 16px;
/*float: right;*/
}
#nava
{
font-size: 20px;
color: white;
font-weight: bold;
font-style: italic;
margin-top: 20px;
display: inline-block;
/*margin-left: 500px;*/
}
/* use padding to pad elements */
.navigation > * {
padding-left: 1em;
}
<div class="navigation-bar">
<a class="navigation-div-blur">
<div class="navigation-div">
<nav class="navigation">
<!-- -->
<h1 id="nava">test</h1>
<h1 id="mailtext">Mail Us <img id="mailpicture" src="images/gmail.png"> </h1>
</nav>
</div>
</a>
</div>
In #mailtext the margin-left:1230 is the problem. Keeping your code just as it is the only change you'll have to make looks like this:
#mailtext
{
float: right;
font-size: 20px;
color: white;
font-style: italic;
}
change your
#mailtext
{
margin-top: 20px;
display: inline-block;
margin-left: 1230px;
font-size: 20px;
color: white;
font-style: italic;
}
to
#mailtext
{
margin-top: 20px;
display: inline-block;
float:right;
font-size: 20px;
color: white;
font-style: italic;
}
Hope it solves your problem
quick note: I just started learning HTML yesterday, this is incredibly new to me so don't be too harsh please--that said, if anyone sees any code that could be done in a simpler way or has any random advice outside of what I'm requesting, please don't hesitate to share. I have a feeling this is terribly scripted, this site is more to help me learn html than for actual use, so there are some area's where I was just using trial and error to make certain things work, and as a result you might see unnecessary code lying around. Point that out too if it bugs you!
ANYWAY, on to the point of the post. I want to have div.textbox inside of div.contentbg with margin-top: 15px. When I try this, however, it applies the margin to div.contentbg instead of div.textbox... it's probably something really stupid. Any help? Thanks in advance! :D
Here's the site: http://jsfiddle.net/gbk8zhwv/1/embedded/result/
Here's the code:
<html> <title>JBROblivion</title> <head> <style> * {
margin: 0;
padding: 0;
}
body {
background-color: black;
margin: 0px;
padding: 0px !important;
height: 100%;
}
a {
margin: 0;
padding: 0;
}
img {
display: block;
margin: 0;
padding: 0;
}
div.contentbg {
background-color: #660000;
width: 1000px;
margin-left: auto;
margin-right: auto;
}
div.textbox {
width: 90%;
margin: 0px auto;
}
div.lrmipsm {
width: 500px;
}
#nav {
width: 100%;
float: left;
margin: 0;
padding: 0;
background-color: #5C0000;
border-bottom: 2px solid #853333;
}
#nav ul {
list-style-type: none;
margin: 0 auto;
padding: 0;
width: 1000px;
}
#nav li {
float: left;
}
#nav li a:link,
a:visited {
display: block;
padding: 15px;
width: 170px;
text-decoration: none;
font-weight: bold;
color: #000000;
background-color: #5C0000;
text-align: center;
text-transform: uppercase;
font-family: "Century Gothic", Arial, Helvetica, sans-serif;
}
#nav li a:hover,
a:active {
background-color: #520000;
}
h1.centre {
font-family: "Century Gothic", Arial, Helvetica, sans-serif;
text-align: center;
text-transform: uppercase;
}
p.introblock {
font-family: "Century Gothic", Arial, Helvetica, sans-serif;
}
</style> </head>
<body>
<img src="http://yt3.ggpht.com/-HKi7fjQseQ0/VJzF49SbsxI/AAAAAAAAAJI/zbpOKJ0Uy0E/w2120-fcrop64=1,00005a57ffffa5a8-nd/Channel%2BArt%2BMask.jpg" alt="Banner" width="100%">
<div id="nav">
<ul>
<li>Home</li>
<li>About</li>
<li>Milestones</li>
<li>Shop</li>
<li>Youtube </li>
</ul>
</div>
<div class="contentbg">
<div class="textbox">
<h1 class="centre">Intro</h1>
<br>
<div class="lrmipsm">
<p class="introblock">Lorem ipsum... sample text.
</p>
</div>
</div>
</div>
</body>
The reason it does not work is because contentbg does not actually have any of its own content. Notice in the example how it works when you run it because there is content in the first div. If you remove "This is some content" it will not appear to work because there is no content to workout where to begin marginalizing (for lack of a better word) from.
Example
div {
background-color: yellow;
}
div.ex {
background-color:red;
margin-top: 40px;
}
<div>This is some content
<div class="ex">This is some content on the inner div.</div>
</div>
In the case you have a div like yours that is empty I would suggest using the padding property instead. This will leave the divs where they are and instead produce some padding around the content of the div you require padding on.
My h1 tag, which is inside a section tag, is smaller than an h2 tag. The h1 tag was the correct size when out side the section tag. I keep looking through my CSS page and am finding nothing that would make this happen.
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-color: #42413C;
margin: 0;
padding: 0;
color: #000;
background-image: url(images/mass_effect_1_citadel_dreamscene_by_droot1986-d5sw7hu.jpg);
}
a img {
border: none;
}
.container {
width: 960px;
background-color: #192370;
margin: 0 auto;
}
header {
background-color: #050a2e;
}
.sidebar1 {
float: left;
width: 175px;
background-color: #2236d1;
padding-bottom: 10px;
border: solid thin black;
text-align: center;
}
.content {
padding: 10px 0;
width: 780px;
float: right;
border: solid thin black;
}
footer {
padding: 10px 0;
background-color: #050a2e;
position: relative;
clear: both;
text-align: center;
}
header,
section,
footer,
aside,
article,
figure {
display: block;
color: white;
}
a:link {
text-decoration: none;
color: #d1bd22;
font-size: 1.3em;
}
a:visited {
text-decoration: none;
color: white;
font-size: 1.3em;
}
a:hover {
text-decoration: underline;
color: #d1bd22;
font-size: 1.3em;
}
a:active {
text-decoration: underline;
color: white;
font-size: 1.3em;
}
<h1>H1 Outside section</h1>
<h2>H2 Outside section</h2>
<section>
<h1>H1 Inside section</h1>
<h2>H2 Inside section</h2>
<section>
<h1>H1 Inside nested section</h1>
<h2>H2 Inside nested section</h2>
</section>
</section>
If you test the situation without your style sheet, you will see that h1 inside a section element appears in a smaller font. This is caused by a browser style sheet, in browsers that support section and its suggested rendering in HTML5. The section element has been defined so that within it, an h1 element is a heading for the section, so relative to the page as a whole, it is at the 2nd level (or even at a lower level, if section elements have been nested).
There are various opinions on the adequacy of that approach, but that’s what HTML5 drafts say and what some browsers have implemented. On the other hand, old browsers ignore such rules, so the approach is not practically robust. It is safer (and quite acceptable according to HTML5) to use h2 for section headings.