Jump to content

Recommended Posts

Hey guys!

I have the following code, which is my main page. My <h1> tag in the title doesn't change when I do the following.. div.title {} but it does when I do this.. div.title h1{}, just like to know why this is so...

 <img class="pc101" src="includes/pictures/pc101.gif" alt="pianocourse101 logo"/>
    <div class="music"><i class="fas fa-music fa-8x"></i></div>

    <div class="sharp"><p>&#9839</p></div>
    <div class="natural"><p>&#9838</p></div>
    <div class="flat"><p>&#9837</p></div>
    

    <div class="main-wrapper">
      <div class="title">
        <br></br>

       <h1>Welcome to PianoCourse101</h1>
     </div>
       <br></br>
    </div>

    <div class="main-wrapper">
      <div class="first">
       <h2>At PianoCourse101, your child can now learn how to play Classical music right from the comfort of your own home! It doesn't matter if your child has no music foundation because there are lessons suitable for beginners and advanced students! Based on the "Bastien Piano Basics series", your child will be able to learn the basic hand positions, posture, finger numbers and letter names!<br></br> There are four levels in the "Bastien Piano Basics" series, beginning with the primer level, which is suitable for beginners. Once your child has completed the primer level, your child will be able to progress to Level 1, follow by Level 2 and Level 3.<br></br>Currently, PianoCourse101 lessons are mainly for children but we also encourage if you are an adult and also wish to learn how to play the piano to join us! In due course, there will also be lessons for adults!
     </div>
    </div>
    
    <div class="form">
    <form class="signup-form" action="newsletters.php" method="POST">
      <div class="newsletters">
       <label><center>Enter your E-mail Address</center></label>
     </div>
       <br></br>
       <center><input type="text" name='email' placeholder="Enter E-mail Address"></center>
       <br></br>
       <center><button type="submit" name="submit">Subscribe to PianoCourse101!</button></center>
       <br></br>

    </form>
    </div>

This is the working CSS code:

div.title h1{
   position: absolute;
   left: 700px;
   top: 700px;
   
   line-height: 100px;

   font-family: 'Aldrich', sans-serif;
   font-family: 'Mr Dafoe', cursive ;
   font-size: 50px;
}

 

Link to comment
https://forums.phpfreaks.com/topic/307522-h1-tag-not-styled/
Share on other sites

They did for me. I checked the page in Chrome, Firefox and Internet Explorer.

Just be aware that your <h1> tag content may end up overlapping your other content at some point. Basically you are locking the <h1> tag so that it is always 700 pixels from the top and 700px from the left of its "closest positioned ancestor". More information about the CSS position property can be found here:

https://developer.mozilla.org/en-US/docs/Web/CSS/position

Link to comment
https://forums.phpfreaks.com/topic/307522-h1-tag-not-styled/#findComment-1559808
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.