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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:30:26+00:00 2026-06-13T06:30:26+00:00

I put down an example below that I have trouble with: <div class=text1>Text 1</div>

  • 0

I put down an example below that I have trouble with:

<div class="text1">Text 1</div>
<div class="text2">Text 2</div>

Link: http://jsfiddle.net/qhoc/SQpdu/5/

Text 1 has pseudo-element but the height being adjusted with the pseudo-element height.

Requirements:

a. Text 1 height same as Text 2 height

b. The red rectangle in the middle of the button.

c. The text must have space around them

d. Everything has to be position:relative, at least not absolute or fixed because this is just a button that could be placed anywhere.

I could just (a) remove padding: 6px 12px; and add height: 30px; but then my text won’t be in the middle with space around it OR (b) add another inner div within Text 1 and make that the red rectangle but I rather not add div.

Is there a way to work around this?

UPDATE: I changed the correct link and clarify the requirements.

  • 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-13T06:30:28+00:00Added an answer on June 13, 2026 at 6:30 am

    I don’t know what exactly you want but try this maybe helpful

    .text1, .text2 {
        width: 200px;
        padding: 8px 12px;
        display:block;
        background-color: gray;
        margin: 5px;
        height:20px;
    }
    .text1{
        height:28px;
       padding:0px 12px 8px 12px;
    }
    .text1:before {
        content:"";
        background: red;
        display: block;
        position: relative;
        width: 20px;
        height: 10px;
        left: 110px;
        top: 15px;
    }
    ​
    

    DEMO

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

Sidebar

Related Questions

I have the following example of a accordion. http://jsfiddle.net/zidski/NU7Gp/14/ If you click down on
I have a textbox that when you put focus into it, it drops down
I put together a fiddle with a very basic hover example. http://jsfiddle.net/qhj2P/ Here is
in this page http://api.jquery.com/category/effects/ when you put 'up'(keyboard) and 'down',then put 'enter',it will go
I have a drop down list and I want the selected value to put
In Theory I have a div (container) that when hovered over one of its
i have two excel sheets An example of the two sheets are below sheet1
Somewhat confusing so its easier if I put down example and expected output to
I want to put an interface down and up every 1 second for 80
I'm attempting to put a few drop down menus inside of an a4j:repeat. The

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.