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

The Archive Base Latest Questions

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

I want to use span inside div div is used to put a red

  • 0

I want to use span inside div

div is used to put a red horizontal line

<div style="background-color:red;">
</div>

span is used inside div to put elements to right

<div style="background-color:red;">
<span style="float:right;">
ABC
</span>
</div>

But the horizontal line do not get red color, only ABC is shown in right, infact there is no effect of div style like width:900px..….why?

  • 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-13T09:24:27+00:00Added an answer on June 13, 2026 at 9:24 am

    I’d suggest:

    <div style="background-color:red; text-align:right;">ABC</div>
    

    Otherwise, you need to add overflow:auto to your div’s style definition if you do want to leverage the <span> as in your original example.

    Cheers

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

Sidebar

Related Questions

I have a span inside a legend tag that I want to use to
I use the following , <div id='message' style=display: none;> <span></span> <a href=# class=close-notify>X</a> </div>
Given the following HTML: <!doctype html> <html> <body> <span style=background-color: blue;> Some text here
I want to use a controller to print test1 test2 inside a <div> ...
i want to use a icon in jQuery Mobile on a span element...and i
I have the following HTML: <span id=UnitCost5>$3,079.95 to $3,479.95</span> And i want to use
I want to use a php boolean variable inside a jquery if-statement. This is
I have some HTML: <div align=center style=border:1px solid red> This is some text in
var html = '<div class=item>abcabc<span>sasd</span></div>'; How can I use JQuery to retrieve the stuff
I have a div with some span tags inside that are containers for input

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.