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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:45:36+00:00 2026-06-16T08:45:36+00:00

I want to get this when resizing the browser window: And I have this

  • 0

I want to get this when resizing the browser window:

enter image description here

And I have this HTML:

<a class="article-link-block" href="#">
<img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
<div class="article-info">
    Article Info need to be 20% of the height and always at the bottom
</div>
</a>

I can get everything but not the 20% of the height for article info.

I can only make it e.g. 50px height and then margin-top: -50px and it is ok, for maximum width. but when I start decreasing the width of the browser it doesn’t change the height only the width, which is 100%.

Any advice/techique how can I dynamically resize height and stay at the bottom all the time?

If I use margin-top: -20%; height: 20%; for .article-info

it creates something like that:

enter image description here
But this is wrong, of course.

Btw. CSS is

.article-link-block {
    display: block;
    float: left;
    width: 100%;
    position: relative;
    height: auto;
}

.article-link-block img {
margin: 0px;
padding: 0px;
display: block;
float: left;
}

.article-info {
    background: black;
    width: 100%;
    height: auto;
    float: left;
    position: relative;
    display: block;

        margin-top: -20%;
    height: 20%;

}

EDIT EDIT EDIT

<body>

    <div id="header">
        <!-- header is 100% width of body width-->
    </div>

    <div id="content">
        <!-- container is 100% of body width -->

        <div id="articles"> 

                <!-- articles are 70% of container width-->

                <a class="article-link-block article-1" href="#">
                <img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
                <div class="article-info">
                    Article Info need to be 20% of the height and always at the bottom
                </div>
                </a>

                <a class="article-link-block article-2" href="#">
                <img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
                <div class="article-info">
                    Article Info need to be 20% of the height and always at the bottom
                </div>
                </a>

                <a class="article-link-block article-3" href="#">
                <img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
                <div class="article-info">
                    Article Info need to be 20% of the height and always at the bottom
                </div>
                </a>

                <a class="article-link-block article-4" href="#">
                <img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
                <div class="article-info">
                    Article Info need to be 20% of the height and always at the bottom
                </div>
                </a>

        </div>

        <div id="sidebar">
                <!-- sidebar is 30% of container width -->
        </div>

    </div>

    <div id="footer">
        <!-- footer is 100% of body width -->
    </div>

</body>
  • 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-16T08:45:37+00:00Added an answer on June 16, 2026 at 8:45 am

    Although I believe wrapping a block-element in an <a> is HTML5 compliant, it’s not necessary.

    CSS

    a { position:relative; outline:1px dashed red; display:inline-block; width:100% }
    
    span {
        position:absolute;
        bottom:0;
        height:20%;
        padding:5px;
        background-color:#ccc;
        width:100%
    }
    
    img { width:100% }
    

    HTML

    <p style="background-color:black"><!-- remove inline style in production code -->
        <a href="#" class="article-link-block">
            <img src="http://c69282.r82.cf3.rackcdn.com/361.jpg">
            <span>Article Info need to be 20% of the height and always at the bottom</span>
        </a>
    </p>
    

    Fiddle:   http://jsfiddle.net/9dt7w/

    EDIT (one picture with multiple articles). Instead of using a <span> use a list.

    <img>
    <ul>
      <li>article</li>
      <li>article2</li>
    </ul>
    

    Fiddle for that one: http://jsfiddle.net/vtZ8g/

    EDIT – Accepted Answer
    http://jsfiddle.net/MXXaS/

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

Sidebar

Related Questions

I want to get this straight. I know what DLL's are. I have done
I want to get a window like this How should i get this and
I can't get this to work.. I have an String which I want to
i am trying to get the new browser width after resizing. i have tried
I want to get this image uploading script right, but for whatever reason it
I really want to get this to work, but I feel like I've been
document.onkeydown.toString() returns onkeydown function but I only want to get this function's name. Is
I've tried several ways to get this to render correctly. I want my logo
I want to create a PlayN game, but in Eclipse I get this errors:
I want to get 100 and example from this string ?connect:100/username:example/ I searched in

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.