What could be causing only certain portions of my CSS to be applied?

I've been struggling to get rid of the gray border around the SIGN UP button in the tbody section. I've tried applying classes (along with the ID) and using pseudo classes like :4th-child {border:none}, but nothing seems to work. The only solution that somewhat works is removing the entire border-right:1px solid gray from the #signup td:, but that's not ideal. Here's the relevant code snippet:

HTML

  <div id="signup">
    <form action="" method="GET" id="form">
      <fieldset>
        <table>
          <thead>
            <tr>
              <th><label for="signupname">Sign Up</label></th>
            </tr>   
          </thead>
          <tbody>
            <tr>
              <td><input id="signupname" placeholder="Your Name"></td>
              <td><input type="password" placeholder="Password"></td>
              <td><input type="email" placeholder="Email (optional)"></td>
              <td><input type="submit" value="Sign Up"></td>
            </tr>
          </tbody>
        </table>
      <fieldset>
    </form>
  </div>

CSS

#signup{
  height:28%;
  min-height:90px;
  background-color:seashell;
  padding-top:1px;
  margin-top:-1px;
}
#signup label{
  font:200% Corbel;
  text-shadow:0px 1px 0px white;
  color:maroon;
  font-weight:bold;
}
#signup table{
  margin:2% auto;
}
#signup td{
  padding:5px 50px;
  border-right:1px solid gray;
}
#signup th{
  padding:0 50px;
}
#signup input{
  font:130% Trebuchet MS;
  padding:5px 5px;
}

Any help would be greatly appreciated!

Answer №1

Your nth-child syntax needs correction

#signup td:nth-child(4) {
  border: none;
}

For a better approach, consider using last-child instead

#signup td:last-child {
  border: none;
}

Another option is to add a specific class to the td element:

<td class="submitrow"><input type="submit" value="Sign Up"></td>

...

#signup td.submitrow {
  border: none;
}

Answer №2

Make sure to properly close the <fieldset> tag. Here's a corrected version:

  <div id="register">
    <form action="" method="POST" id="form">
      <fieldset>
        <table>
          <thead>
            <tr>
              <th><label for="registername">Register</label></th>
            </tr>   
          </thead>
          <tbody>
            <tr>
              <td><input id="registername" placeholder="Your Name"></td>
              <td><input type="password" placeholder="Password"></td>
              <td><input type="email" placeholder="Email (optional)"></td>
              <td><input type="submit" value="Register"></td>
            </tr>
          </tbody>
        </table>
      </fieldset>
    </form>
  </div>

#register{
  height:25%;
  min-height:90px;
  background-color:seashell;
  padding-top:1px;
  margin-top:-1px;
}
#register label{
  font:200% Corbel;
  text-shadow:0px 1px 0px white;
  color:maroon;
  font-weight:bold;
}
#register table{
  margin:2% auto;
}
#register td{
  padding:5px 50px;
  border-right:1px solid gray;
}
#register th{
  padding:0 50px;
}
#register input{
  font:130% Trebuchet MS;
  padding:5px 5px;
}

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

Trouble with jQuery delay in updating the CSS attribute while using fadeIn

After writing a simple JQuery code, I noticed that every time I click on 'eat', the animation lags. Is there any way to preload this animation for smoother performance? The #custom_menu element is a full-page section with a fixed position (simil ...

What is the process for setting dynamic variables as CSS content within Vue.js?

Forgive my lack of expertise, but I am interested in learning more about utilizing dynamic variables and CSS within Vue. I have a concept in mind where pressing a button would result in the letters of the button label spacing out further. Is it feasible t ...

Consistent word spacing across several lines

Can someone help me with an issue I'm facing? It seems simple, but I can't seem to figure it out. I am looking for a way to maintain consistent spacing between words on multiple lines without using tables. Essentially, I want something like invi ...

Is it possible to incorporate both a file input and text input within a single form?

Is there a way to incorporate both a file input and text input into the same form? Appreciate your help in advance ...

How can I ensure that a button remains fixed at the bottom of a Material UI React Component?

I am currently working on developing a layout for a web application, and I have encountered an issue that I am struggling to resolve. The structure of my grid is as follows: https://i.sstatic.net/TEU2a.png My goal is to ensure that each section inside t ...

What is the significance of using HttpUtility's HtmlDecode function in my code?

One of my ASP.NET MVC controllers returns a view where I generate some HTML code. For example: @Html.ActionLink(HttpUtility.HtmlDecode("&iquest;Olvid&oacute; su contrase&ntilde;a&#63;"), "ForgotYourPassword", "Account", null, new { style = ...

Tips for preventing text wrapping in off-canvas design

Seeking advice for my Web Application prototype - looking to prevent text wrapping in off-canvas menu paragraphs using CSS or JS. New to building this type of menu, I used an example from W3Schools to achieve the current design. <!DOCTYPE html> ...

Adjusting the Size of an HTML Slideshow

While designing a homepage for my band, I encountered an issue when trying to integrate a slideshow element from an external source. The size of the slideshow is fixed at 600 x 300px and cannot be adjusted. Additionally, I found it challenging to position ...

Showing a diverse range of data types with null values in the Django admin list_display

My explanation of the title might have been unclear. I have a simple chat application where users can send text, audio, video, or images. To render these messages, I have a method that checks the message type and renders it accordingly. If the message is t ...

Issue encountered while attempting to deactivate certain foundation CSS and JavaScript files

I am attempting to deactivate certain CSS files in the foundation framework, as they are unnecessary for my project. After installing foundation via a gem, I followed Ryan Bates' recommendation to modify the foundation_and_overrides.scss file by repl ...

Content within a div that is floated left

The scenario at hand is: HTML Structure: <div id="main"> <div id="a"></div> <div id="b">Some Text</div> </div> CSS Styles: #a{ float:left; width:800px; height:150px; background-color:#CCC; } ...

Double Row Navbar Struggles in Bootstrap 4

I have been experimenting with creating two bootstrap navbars. The first one features the website's domain name in the center, accompanied by a dropdown menu to navigate to other sections. Each of these sections has its own subbar containing specific ...

showing database table contents on a website page

What is the best way to retrieve data from a MySQL database that corresponds to user input on a web page, and then showcase the content without having to reload the page using PHP or another suitable language? I would greatly appreciate any assistance wi ...

How can I preloaded self-hosted fonts in Next.js without receiving a console warning for not using the resource within a few seconds?

I am working on a project in Next.js and I want to preload my self-hosted fonts. In my code, I have the following setup: Inside my _app.js file: <Head> <link rel="preload" href="/fonts/leira/Leira-Lite.t ...

Set the first link in a menu to be highlighted as active using jquery

In order to mark the first link in my menu as active, I need it to have specific CSS settings applied. Using jQuery to add these settings to every link when clicked on makes it a bit tricky (simple menu = clicking changes color). So, I want the first link ...

What is the best way to align content in the center when its parent element has a position property

JSBIN Is it possible to center the number row without using JavaScript to calculate its position, considering its parent has a fixed attribute? I've tried using CSS properties like margin and text-align with no success. Any suggestions on achieving t ...

Error: The term "Image" is unrecognizable

I'm in the process of creating a website where I want to display images via links. If the image is missing or only 1 pixel wide, I need the site to show an alternative image. My technology stack includes Jade/Pug and JS. Before rendering the links on ...

Are you attempting to retrieve the most up-to-date trading price of a stock with Python?

After attempting to extract the LTP of a stock with the code below, I am not getting any value in return. Can you identify the error in the following code: from selenium import webdriver from bs4 import BeautifulSoup driver=webdriver.Chrome("C:&bsol ...

Guide to linking two input fields using a single datepicker

To achieve the goal of filling two input fields simultaneously, take a look at the following code snippet: <mat-form-field> <input matInput [matDatepicker]="startDate" formControlName="SaleDate" /> ...

Creating personalized dots in the owl carousel

I have successfully added custom previous and next buttons to my carousel using Owl Carousel, but I am having trouble displaying the navigation dots. Can anyone help me identify where I might have made a mistake? // owl.carousel.css .owl-controls { ...