Is there a potential issue with descender tags causing the malfunction of HTML and CSS tags?

Having some trouble with my <p> tag in the CSS. Can't seem to figure out why it's not working correctly. Any help is appreciated.

Here's the HTML:

<body>
<section>
<section id="pictures">
    <div>
        <img src="images/ritual4.jpg" id="slide" class="floatLeft" alt="Group of young men posing and smiling">
        <script language="JavaScript">slideIt();</script>
        <p>Ritual and Mills Music Mission</p>
        <img src="images/ossian.jpg" alt="Group of dressed up men posing with an older gentleman.">
        <p>Spaghetti Dinner Fall 2015</p>
    </div>
</section>
    <section id="main">
    <h1>About Phi Mu Alpha</h1>
<hr>
<div>
<p id="text">Phi Mu Alpha Sinfonia:</p>
<p id="text1">Phi Mu Alpha Sinfonia was established on October 6th, 1898</p>

    <p id="text">
    Gamma Beta Chapter:
    </p>
    </section>
</section>
</div>
</body>

CSS styling:

#main h1{
    text-align: center;
    font-size: 28px;
}
hr{
    color:#FFFFFF;
}
#main #text{
    text-indent: 5%;
    font-family: courier new, Georgia, Times;
    padding-left: 15px;
    padding-right: 15px;
    font-size: 20px;
    text-decoration: underline;
}
#main #text1{
    text-indent: 5%;
    font-family: courier new, Georgia, Times;
    padding-left: 15px;
    padding-right: 15px;
    font-size: 16px;
    text-decoration: underline;
}

body #main p{
    text-indent: 8%;
    font-family: courier new, Georgia, Times;
    padding-left: 15px;
    padding-right: 15px;
    font-size: 18px;
    text-decoration: underline;
}

Answer №1

Your code needs some cleaning up, to be honest. I made a few changes, but if you'd like it tidied up further, I can help with that too. Otherwise, take a look at this revised code:

HTML:

<section id="pictures">
    <div>
        <img src="images/ritual4.jpg" id="slide" class="floatLeft" alt="Group of young men posing and smiling">
        <script language="JavaScript">slideIt();</script>
        <p>Ritual and Mills Music Mission</p>
        <img src="images/ossian.jpg" alt="Group of dressed up men posing with an older gentleman.">
        <p>Spaghetti Dinner Fall 2015</p>
    </div>
</section>
<section id="main">
    <h1>About Phi Mu Alpha</h1>
    <hr>
    <div>
      <p id="text">Phi Mu Alpha Sinfonia:</p>
      <p id="text1">Phi Mu Alpha Sinfonia was founded on October 6th, 1898</p>

      <p id="text">
        Gamma Beta Chapter:
      </p>
    </div>
</section>

CSS:

hr {
    color:#fff;
}

#main h1 {
    text-align: center;
    font-size: 2em;
}

#main p {
    text-indent: 8%;
    font-family: "Courier New", Georgia, Times;
    padding-left: 15px;
    padding-right: 15px;
    font-size: 18px;
    text-decoration: underline;
}

#main #text {
    text-indent: 5%;
    font-size: 20px;
}
#main #text1 {
    text-indent: 5%;
    font-size: 16px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Determine the number of elements chosen within a complex JSON structure

I need to figure out how to count the length of a jsonArray, but I'm stuck. Here's an example to start with: https://jsfiddle.net/vuqcopm7/13/ In summary, if you click on an item in the list, such as "asd1", it will create an input text every t ...

Aligning Content in the Center of a CSS Grid

Having difficulty with a CSS Grid layout that should consist of 7 squares per row to create a calendar style design. The layout seems fine, but I am struggling to center the title and subtitle in the middle of each item. I have tried using margin:auto, ver ...

Tips for sending data through an AJAX call to the app.post() function in Express

I am currently working on a blog application using express and node. In order to save a blog post without using a database (as the posts are stored in an array), I need to pass an array of keywords to the app.post() method. To display keywords as separate ...

Tips for creating a form that adapts to different devices, ensuring it looks great no matter the screen size

<div class="modal" id="myModal" style="width:50%; top:15%;" role="dialog" > <div class=""> <!-- Modal content--> <div class="modal-content"> ...

Rails does not transfer data-attributes in HTML5

I have a layout set up to show users: %table.table %tbody - @users.each do |user| %tr %td= avatar_tag user, {small:true, rounded:true} %td = username user .online-tag = user.online? %td= ...

Troubleshooting problem with Bootstrap Modal inputs and header tags

When it comes to the button that says data-whatever="Add a recipe", I think it is causing my input placeholders to be overridden, and I'm not sure why. If I remove it, everything works but the h5 header for the new recipe will be blank. <button ...

Troubleshooting the malfunctioning AngularJS ui-view component

My ui-view isn't functioning properly, but no errors are being displayed. Can anyone help me figure out what I'm missing to make this work? This is the main template, index.html. <!DOCTYPE html> <html> <head> <meta charset= ...

Extracting information from HTML and transferring it to Javascript using jQuery

My goal is to utilize jsGrid for showcasing database data without repeating code extensively. I aim to generate separate grids for each <div> with a specific id while passing on relevant values accordingly. To clarify my objective, here's a sni ...

"Utilizing AngularJS to set an element's position as fixed relative to a different

Imagine an app that can place input text fields on top of an image, creating a workspace. The challenge is to position these fields using specific coordinates (top, left, width, height) that are relative to the image itself (top/left = 0/0). How can one ac ...

Selenium's click() function is functioning properly, however, the submit() function is not working

During my Selinium Webdriver tests, I have encountered a puzzling issue where I am unable to submit a form by using the submit() method on the elements within the form. However, I can successfully submit the form by calling click() on the submit button. To ...

Updating the logo image on mobile devices using responsive CSS styling

My goal is to show a different image to users on mobile devices using only CSS, as I am unable to access the HTML code. On mobile, I used display:none for the header-logo-image img { and then added a background-url to the div to successfully display my alt ...

When using PHP, JavaScript, and HTML, you can trigger an image upload immediately after choosing a file using the

I currently have a small form with two buttons - one for browsing and another for uploading an image. I feel that having two separate buttons for this purpose is unnecessary. Is there a way to combine the browse and upload functions into just one button? ...

Transform preexisting Vue UI library measurements into pixels

I was curious about converting all existing units (em / rem) to pixels. How can I easily convert the entire output units to px? Are there any tricks or methods available? Currently, I am utilizing Vuesax UI to create a plugin for various websites and temp ...

What is the trick to getting the <label> and <input> elements to show up side by side in an HTML form?

I am designing a registration form for a new website. My goal is to have each label and its corresponding input element displayed on the same line. Here's the CSS code I'm using: #registration-form { background-color: #FFF; height: 600px; ...

Encountering issues with loading styles in Vue single file components

While working on my project at this link, I encountered an issue with displaying a styled modal. Despite trying to import the styles using: <style scoped> @import "../styles/modal-style.css"; </style> and even directly pasting the co ...

Combining Multiple Partial Views with Their Respective View Models in ASP.NET MVC: A Step-by-Step Guide

I am working on a view named Register where I include other views using @Html.Partial("ViewName"). I am curious about how to call other ViewModels from the partial views within this main view. While I know that each ViewModel with its fields can be declar ...

Turn off the whole DIV container and its contents once the button is clicked

Here's an example of the HTML markup: <div id="picing-selection" class="disableMe"> <a class="upgradeSub" value="@ViewBag.Id"> Upgrade <i class="fa fa-money"></i> </a> </div> The onclick event is d ...

Leveraging the power of ExpressJs to incorporate a dynamic Navbar onto

ExpressJS and EJS are my chosen technologies for creating Views. When it comes to the navigation bar, I want to add a class="active" to the links that represent the current page. However, if I use partials in my views, how can I achieve this? Here is a q ...

Top tips for optimizing HTML and utilizing div elements

Could you please provide some insights on how to effectively utilize HTML5 in conjunction with div tags? Below is the snippet of my HTML code. I am incorporating the article tag and have segmented sections, which seem to be in order. However, I am also ...

What steps can be taken to ensure the visibility and accessibility of two vertically stacked/overlapped Html input elements in HTML?

I have encountered a challenge with my HTML input elements. There are two input elements that overlap each other, and I would like to make both inputs visible while only allowing the top input to be editable. I have tried several approaches involving z-ind ...