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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:17:53+00:00 2026-05-28T06:17:53+00:00

First I have a pretty casual problem, vertically centering an image inside a list.

  • 0

First I have a pretty casual problem, vertically centering an image inside a list. Most tutorials advise to use line-height = image-height or assigning list item to table and use vertical-align:middle. Neither seem to work for me.
My second problem is having a clickable list link row without jQuery. I’m supposed to make the anchor display:block and set the width to 100%, but then it breaks on another row and is not extended to the left image block.

This is my markup:

            <ul>
                <li>
                    <a href="#">
                        <div id="firstbutton" class="button"></div>
                        <div class="group">
                        one<br/>
                            <span>tagline</span>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <div id="secondbutton" class="button"></div>
                        <div class="group">
                            two<br/>
                            <span>tagline</span>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <div id="thirdbutton" class="button"></div>
                        <div class="group">
                            three<br/>
                            <span>tagline</span>
                        </div>
                    </a>
                </li>
            </ul>

My Css:

ul{
// line-height:180px;
}

li{
height:60px;
min-width:200px;
margin:2px;
}


li a{
display:block;
width:100%;
}

html>body li a {
width: auto;
}

.group{
text-align:right;
float:right;
margin-right:20px;
width:auto;
}

.button{
width:30px;
height:30px;
float:left;
margin-left:20px;
}

And here is a live example of above

And here is an image

  • 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-05-28T06:17:53+00:00Added an answer on May 28, 2026 at 6:17 am

    The W3 validator http://validator.w3.org/check might give you a hint… look the code below.

    I don’t think an <a> tag supports a <div> inside.

    Line 12, Column 61: document type does not allow element “div” here; missing one of “object”, “applet”, “map”, “iframe”, “button”, “ins”, “del” start-tag

    <div id="firstbutton" class="button"></div>
    

    The mentioned element is not allowed to appear in the context in which you’ve placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you’ve forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as “<p>” or “<table>“) inside an inline element (such as “<a>“, “<span>“, or “<font>“).

    I would recommend using the a tag as display:block; in the css and keep on styling.

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

Sidebar

Related Questions

I have a pretty simple image switcher, which I use for manual images switcher
I have pretty much finished my first working Symbian application, but in my hastened
First of all I have to admit that my programming skills are pretty limited
I have a pretty basic question: In GAE, if I use memcache to store
I have a pretty simple general programming problem, yet I can't quite get the
I am learning Java and have a pretty basic problem. I am indexing some
I have a pretty funny problem which involves loadView , viewDidLoad , viewWillAppear and
I'm working on my first Android application and I have a pretty good idea
In order to bring up the menu for a DataGridViewComboBoxCell, I first have to
First I have a Listbox and set the DataSource to a MyObjectCollection MyObjectCollection implements

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.