Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7829027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:35:12+00:00 2026-06-02T10:35:12+00:00

I have created a page which is a login portal to three separate websites.

  • 0

I have created a page which is a login portal to three separate websites. On this page, I have displayed the three login portals to said websites. I am trying to style it all with css and as few classes as possible (I need to fine tune my css skills).

What I have created is a table with three rows and two columns called loginPortals:

<table class="loginPortals">
    <tbody>
        <tr>
            <td>Picture 1</td>
            <td>Login form 1</td>
        </tr>
        <tr>
            <td>Picture 2</td>
            <td>Login form 2</td>
        </tr>
        <tr>
            <td>Picture 3</td>
            <td>Login form 2</td>
        </tr>
    </tbody>
</table>

I’ve only just begun the styling of the table, so it’s very incomplete, however I’m struggling already. This is simplified, because I don’t know exactly how it’s going to look. Basically though, I want a border of some sort appearing between each row. The following doesn’t quite achieve this as I had wanted:

.loginPortals{
    width:100%;
}
    .loginPortals tbody:first-child td{
        border-top:1px solid #000;
    }
    .loginPortals tbody tr td{
        border-bottom:1px solid #000;
        padding:1em 0;
    }

The first-child selector isn’t working as I had thought it would. It is applying the top border to all the cells in all the rows. This is causing the line thickness to double in the middle of the rows.

How do I fix this so that the top border is only applied to the top row without creating extra classes or applying any inline style.

Thank you!
Joe

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:35:19+00:00Added an answer on June 2, 2026 at 10:35 am

    Your table borders need to be set to collapse:

    .loginPortals{
        width:100%;
        border-collapse: collapse;
    }
    

    You can then omit the :first-child rule and just apply top and bottom borders for all your rows:

    .loginPortals tbody tr td{
        border-top:1px solid #000;
        border-bottom:1px solid #000;
        padding:1em 0;
    }
    

    Also, just for your information, this selector:

    .loginPortals tbody:first-child td
    

    Means:

    Select any td element
    within a tbody
    that is the first child of its parent.

    And not:

    Select any td element
    within the first child of a tbody.

    So since the tbody is the first and only child of .loginPortals, all the td elements in all their tr parents will be selected. See this answer for a visual explanation. You probably wanted this selector:

    .loginPortals tbody tr:first-child td
    

    But that’s not necessary because all you have to do is collapse your table borders.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a login page. In this page i used div tag which
I have created an app which starts with a login page, after entering some
I have created a simple login page which is based on the sessions. session_start();
I have a Login Page which is created in asp.net now when i successfully
I have created a simple login page for asp.net which takes in user name
I have created a login page which authenticates a user via the atuthentication class.
I have created a JSF 2 page which uses Facelets to define the structure
I have a page which contains a jQuery-UI horizontal slider, created using a little
I have a module in which I created a custom page with controller and
I have a page with a UserControl (in which linkbuttons are dynamically created). On

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.