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 7398091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:49:43+00:00 2026-05-29T03:49:43+00:00

Im having trouble lining up my elements correctly. What i want is to lign

  • 0

Im having trouble lining up my elements correctly. What i want is to lign up my form elements the same way as I’ve lined up the elements above. The top “list” is a definitionlist (dl) and its children. I don’t want to use dl for aligning my form elements as it’s not semantically correct, and we might have people using screenreaders using the application. I’ve tried to use unordered lists, but I didnt figure out how to style them properly to get the desired result.

Problem image

(Tilgangstype and Fagområde also contains select lists, ive just hid them and forgot to show them for the screenshot, same formating problem though)

This is the code I’ve been using for the top elements:

.styled-form label, .def-list dl dt {
background:#5D6DA7;
color:#fff;    
float:left;    
font-weight:bold;    
margin-right:10px;    
padding:5px;    
width:130px;
}

.styled-form input, .styled-form select, .def-list dl dd {
margin:2px 0;    
padding:5px 0;
}

I also want the line’s to break after the “block” of label and input/select.
Heres the code for the form

            <!-- Pick hospital, roles and professions -->
        <label for="Hospitals">Arbeidssted:</label>
        <select id="Hospitals" name="Hospitals">
        </select><br/>
        <label for="HospitalRoles">Tilgangstype (rolle):</label>
        <select id="HospitalRoles" >
        </select><br/>
        <label for="HospitalProfessions">Fagområde:</label>
        <select id="HospitalProfessions" >
        </select><br/>
        <!-- Start-End date -->
        <label for="FromDate">Startdato:</label>
        <input type="text" class="date" name="FromDate" id="FromDate" /><br/>
        <label for="ToDate">Sluttdato:</label>
        <input type="text" class="date" name="ToDate" id="ToDate" /> (Fylles ut ved tidsbegrenset tilgang)<br/>

(sorry for the <br/> tags)

  • 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-05-29T03:49:44+00:00Added an answer on May 29, 2026 at 3:49 am

    Wrap your label+input combinations in an extra each, so it looks like this:

        <div>
        <label for="Hospitals">Arbeidssted:</label>
        <select id="Hospitals" name="Hospitals">
        </select>
        <div>
    

    and then clear each div inside the form:

        form.theFormClass div{clear:both;}
    

    The clue of when to use a wrapping div is where you find yourself saying “a ‘block’ of elements”, just as you did 🙂

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

Sidebar

Related Questions

Having trouble vertically lining up inline elements - I want the email image to
I'm having trouble lining up the elements in my div containing the text input
Having trouble with a mysql grant statement. I want a user who has: readonly
I'm having some trouble arranging my models in an efficient way. Thing of these
I'm trying to make a link list and I'm having trouble with the concept
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
I'm new to programming, and I'm having trouble linking to a Boost library in
I'm having trouble with the linking of my files. Basically, my program consists of:
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
Having trouble with the following segment of code. I'm getting a parameter count mismatch.

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.