SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add image and link to header

    Hi,

    which code I will must insert to header to add a image with external link and customize (margin & padding) to set it to the right place...

    Which class I will must use, or can I do it without it?
    I would like to add it under the logo.

    Here's a some code(logo)

    PHP Code:
    /*---------HEADER STUFF-----------*/
    a#logo  {width:100%; background: #000; background:rgba(0,0,0,.85); display: block; clear: right; padding: 80px 0; text-align: center; color: #fff; margin-bottom: 0px;}
    a#logo:hover {text-decoration: none;}
    a#logo img {max-width: 80%;} 
    Regards

  2. #2
    SitePoint Addict
    Join Date
    Apr 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post a link to the page you're trying to change? That will help people answer your question correctly.

  3. #3
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have it on localhost...some other way to help?

  4. #4
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have set the website online

    It's located here:

    http://tinyurl.com/cym2y4t

  5. #5
    SitePoint Addict bronze trophy
    Join Date
    Mar 2013
    Location
    Oneonta, NY
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Bingo,

    The code you posted does not make a whole lot of sense. It appears to be CSS code however there are no style tags. I looked at the source for your web page and the same snippet does not exist in the head section.

    If you want to add a logo and style it, you should just place a image tag inside of a div tag in your header.php file or equivalent for your theme. It may look something like this,

    <div id=”header_logo”>
    <a href=”yourexternallink”><img src=”yourimagepath” alt=”” /></a>
    </div>

    Your corresponding CSS might look like this

    #header_logo
    {
    Float: left;
    Margin: some value;
    Padding: some value;
    }

    I cannot put values for your margin and padding or know if these are even relevant for you to use without knowing what your header.php file looks like or how other elements on the page are positioned but this should point you in the right direction.

    Best,

    Shawn


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •