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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:21:09+00:00 2026-06-10T19:21:09+00:00

I have an image in the css, but I want to add a link

  • 0

I have an image in the css, but I want to add a link to that image so I pulled it out of the css and inserted directly in the HTML with an anchor tag.

I am having trouble aligning the image to the top left of the div class.

<div class="logoHeader" style="height:125px; width:900px" >
    <a href="http://www.abc123.com/">
        <img src="images/logo.jpg" alt="" style="position:relative;" />
    </a>
</div>

I’ve tried adding

style="padding-top:0px; padding-left:0px;"

but the image is floating instead of being in the top left corner.

Any thoughts on how to get the image to align to the top left corner via the HTML?

The div tag css is:

.logoHeader {padding:45px 20px 0px 20px;}
  • 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-10T19:21:10+00:00Added an answer on June 10, 2026 at 7:21 pm

    The padding is causing it to float, it’s conforming to the rules you set (have a margin of 45px), if you want it in the top left corner:

    See http://jsfiddle.net/9KJA7/ for an example

    /* Ignore */
    .logoHeader {background-color: red}
    img {height: 50px; width: 50px; background-color: green}
    
    /* Your code */
    .logoHeader {padding:45px 20px 0px 20px; position: relative}
    ​img {position:absolute;top:0px;left:0px;}​​​​​​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a logo link that's using a background-image (css sprite). All works fine,
I have emoticons in a css sprite image that I want to display within
I have a simple CSS image map that works like this: HTML: <div style=display:block;
I have a CSS entry that looks like this: .header { background-image: url(./images/embouchure.jpg); background-repeat:
I have a panel in asp page and I want to add image to
I have a CSS based menu and I want to add a Slide down
I have a div that contains an image and a p tag (seen below).
I have this line of css for a image that I will fade in
I am learning how to use HTML and css, and want to add a
I have an image slider (CSS based) customised to my specifications (font styles, size

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.