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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:33:58+00:00 2026-06-06T13:33:58+00:00

I have a square div (called square) and trying to put another div (caption)

  • 0

I have a square div (called “square”) and trying to put another div (“caption”) inside the “square”. But the caption goes outside the square boundaries! How to cut its size to the exact boundaries of the parent div?

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        body {
            background-color: #000000;
        }
        a {
            text-decoration: none;
            color: #FFFFFF;
        }
        div.square {
            background-color: #1BA1E2;
            display: inline-block;
            width: 44px;
            height: 44px;
            margin: 0 6px 0 9px;
        }
        div.caption {
            display: inline-block;
            margin: 15px 0 0 3px;
            padding: 0;
            color: #FFFFFF;
            font-size: 24px;
        }
        span.description {
            display: inline-block;
            vertical-align: bottom;
            font-size: 18px;
        }
    </style>
</head>
<body>
    <p>
        <a href="page">
            <div class="square">
                <div class="caption">
                    Caption
                </div>
            </div>
            <span class="description">
                Description
            </span>
        </a>
    </p>
</body>
</html>

In this case, Caption should be cut to Cap+ 1/2t inside the blue box (something like WP7 style). And a description alongside.

  • 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-06T13:33:59+00:00Added an answer on June 6, 2026 at 1:33 pm

    Put overflow:hidden in the styles for div.square. This will cause the caption to cut off at the boundaries of the box.

    Running example

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

Sidebar

Related Questions

I have a <div> , and in jQuery I want to divide this square
I have 3 square. smallest square s3 is inside s2. s2 is in side
Given a div square and given I already have a touchmove function on that
Let's say I have a DIV that's styled as a square, and it has
I have a square div of fixed size and wish to place an arbitrary
I have a div with an onmousedown event, but it is triggering when I
I have a div that is deliberately smaller than its content (I'm making a
I have four divs contained in another div, and I want the four inner
I have the following code: http://jsfiddle.net/cosoroaba/nCEwv/ HTML: <div id=square> <div class=corner-wrapper> <div id=ctr></div> </div>
I have a div that contains questions Questions 2: What is the square root

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.