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

  • Home
  • SEARCH
  • 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 8972547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:14:32+00:00 2026-06-15T18:14:32+00:00

I have two text boxes: <label class=q>A<input maxlength=9 /></label> and <label class=q>B<input maxlength=9 /></label>

  • 0

I have two text boxes:

<label class="q">A<input maxlength="9" /></label>

and

<label class="q">B<input maxlength="9" /></label>

I want to split these two boxes with a vertical line, on the center of the line, there’s an “OR” text.

The idea was to make it clear to the user that input in either of the textbox is fine.

I tried using float:left and float:right to separate the two areas and use border-left: 1px solid gray as a separator, but how can I display a text in the middle of a vertical line?

  • 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-15T18:14:33+00:00Added an answer on June 15, 2026 at 6:14 pm

    One way is to insert an element between them and inside it put the OR and the vertical line.

    Demo at http://jsfiddle.net/gaby/4hCUq/1/


    Another would be to use CSS only for it (by using pseudo elements like :before and :after to insert the line and text)

    HTML

    <label class="q">A<input maxlength="9" /></label>
    <label class="q or">B<input maxlength="9" /></label>
    

    CSS

    .q{
        float:left;
        margin-left:50px;
        width:150px;
        position:relative;
    }
    .or:before{
        content:' ';
        width:1px;
        height:150%;
        top:-25%;
        background-color:black;
        left:-25px;
        position:absolute;
        z-index:100;
    
    }
    .or:after{
        content:'OR';
        left:-50px;
        position:absolute;
        z-index:101;
        background-color:white;
        font-size:smaller;
        top:2px;
        text-align:center;
        width:50px;
    }
    

    CSS Demo at http://jsfiddle.net/gaby/4hCUq/

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

Sidebar

Related Questions

I have two text boxes and i want to send these two text box
In my code, I have two text boxes that validate input as the user
I have two input text boxes which are decimal. The sum of the two
I have two text-boxes which are used to select a From and a To
I have two text boxes t1 and t2 in an html page. I'd like
I have a form with two text boxes, one select drop down and one
I have a table which has two text boxes and an image beside it
I have a simple in VB/ASP.NET form containing two text boxes, I am attempting
I have a user control in my wp7 application which contains two text boxes
I have two text boxes. one for login id and another is for password.

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.