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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:58:39+00:00 2026-06-11T18:58:39+00:00

I trying to add an break before an element in css without changing the

  • 0

I trying to add an break before an element in css without changing the underneath html codes. I been searching around this forum for answers, but couldn’t make it work across the different browsers.

HTML ( unchangeable, as it’s part of an joomla component )

    <span id="mod_login_usernametext-map"> <label for="mod_login_username-map"> Email </label> </span>

    <span><input type="text" name="username" id="mod_login_username-map" class="inputbox-map" /></span>

    <-- here i want the break -->

    <span id="mod_login_passwordtext-map"><label for="mod_login_password-map">Password</label></span>&nbsp;<span><input type="password" name="passwd" id="mod_login_password-map" class="inputbox-map" />

    <-- and break here -->
    <input type="checkbox" name="remember" id="mod_login_remember-map" class="inputbox-map" value="yes" /> <span id="mod_login_remembermetext-map"><label for="mod_login_remember-map">Remember me</label></span>

I tried #mod_login_passwordtext-map:before { content: '\A';white-space: pre-line; } but didn’t turn out very well in firefox, chrome fine..

Using display: break doesn’t put the input box on the same level.. Easiest would have been if I just could have added an wrap element around, but no can do that..

Any tips?

  • 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-11T18:58:40+00:00Added an answer on June 11, 2026 at 6:58 pm

    Try it with this css:

    #mod_login_passwordtext-map:before {
      content: '\A';
      white-space: pre;
    }
    

    Demo: codepen

    Works well on FF and Chrome for me.

    Best regards

    EDIT:

    This will add a break to your login button too + align the two input fields:

    #mod_loginform-map #mod_login_passwordtext-map:before,
    #mod_loginform-map .cbLoginButtonSpan:before {
      content: '\A';
      white-space: pre;
    }
    
    #mod_login_usernametext-map label,
    #mod_login_passwordtext-map label {
      display: inline-block;
      width: 6em;
    }
    

    Demo: codepen

    EDIT 2:

    U cant add :before and :after pseudo classes to input elements.

    Why?

    Because :before is added before the content of an element and :after is added after the conetent of an element not before or after the element itself.

    An input element dont have content, only a value.

    Hope this helps.

    EDIT 3:

    To get a new line, with CSS, for the Remember me input i see only one way.

    #mod_loginform-map #mod_login_passwordtext-map:before,
    #mod_loginform-map .cbLoginButtonSpan:before,
    #mod_loginform-map span:nth-child(4):after {
      content: '\A';
      white-space: pre;
    }
    

    Demo: codepen

    But this workaround is a bit crappy in my eyes.

    Best regards

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

Sidebar

Related Questions

I have been trying to add a button after a parser ( on a
I'm trying to dynamically add results to this display and I simply want to
I'm trying to find out how to have my eclipse automatically add a break;
This question has been asked before in earlier versions of MVC. There is also
I'm trying add data triggers to the default combobox style so each text item
I am trying add picture boxes dynamically. My code is as PictureBox picture =
Im new to asp.net mvc. I'm trying add new model class but it got
Trying to add init parameter names to a list in init(ServletConfig) method. public void
Trying to add a blank sample app for a rails tutorial to GitHub, but
Trying to add a 'box' to a form at design time, I looked up

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.