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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:20:43+00:00 2026-05-26T07:20:43+00:00

you probably see this question a lot. However, I’ve been through threads and I

  • 0

you probably see this question a lot. However, I’ve been through threads and I can’t seem to find a solution to my situation. It’s probably something very minute that I’m missing, or perhaps I’m just barking up the wrong tree all together.

Basically what I’m trying to do is take an anchor with a {display:block;} with a set height and width and have its text be vertically and horizontally centered.

Right now this is my css

.logo
{
    width:140px;
    height:75px;
    border-right:1px dotted black;
    border-bottom:1px dotted black;
    float:left;
    text-align:center;
    font-size:15px;
    font-weight:bold;
    color:#c60606;
}

.logo a
{
    display:block;
    width:140px;
    height:75px;
    background-color:#fff;
    font-size:15px;
    font-weight:bold;
    color:#c60606;
}
/*the reason for the double declaration of text information is because
  some of the logo divs do not have anchors in them, and it's for uniformity
  purposes.
*/

.logo a div
{
    margin-top:10px;
}

and then the html would be

<div class="logo"><a href="#"><div>my link</div></a></div>

Now the reason i stuck a div inside of the anchor is because I thought it would be a good way to separate the text from the actual block, but with that margin setting it moves the anchor down instead of just the text. The vertical-align attribute does basically nothing, and I’m at a loss in terms of what to do. Any suggestions or restructuring ideas would be great. Thank you.

a sample can be found at http://www.dsi-usa.com/test/clientele.php feel free to browse the site it’s still a work in progress a lot has to be organized and re-coded. Anyhow, that sample is exactly what I want, just need the text to be vertically aligned as well.

  • 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-26T07:20:43+00:00Added an answer on May 26, 2026 at 7:20 am

    You can’t have a <div> inside an <a>, it’s invalid HTML. Use a <span> set to display: block; instead.

    Update:

    As of HTML5, you can now have a div inside an anchor (or any block level element.)

    For this to be legal though, you must use the HTML5 doctype:

    <!DOCTYPE html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a dumb question, but I can't seem to find a good
You can probably see where I am going with this - but is there
So, yes, this is probably 1000th question on the subject. However, my question is
This is probably something really simple but I cant see what! Any images I
This is probably just wishful thinking... Is there any way to check to see
Probably a long question for a simple solution, but here goes... I have a
So, I've been seeing a lot of SQL examples on this site. I have
I see this in Facebook (also Google), but can't figure out how to do
I know this question has been asked many times here and elsewhere before as
This is probably a very simple question, but at this time I have myself

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.