How to put linked images left and right of wordpress theme?

Discussion in 'HTML & Website Design' started by loukaselessar, Jun 23, 2012.

  1. #1
    Hello,

    I'm new to this forum and would like to ask if anyone can help me as I am having trouble putin images left and right in main body of my wordpress site. I need to have one linked image left and right the main body and be able to stay there not pass by as you schroll down with mouse.

    I understand I have to put:

    <div id="main-wrapper"> <div id="leftimage">left image here</div>
    <div id="middle-col">all other page content here, include header, index, footer</div>
    <div id="rightimage">right image here</div></div>

    In header.php and

    #main-wrapper {
    width: 1150px;
    position:relative;
    margin: 0 auto;
    }

    #leftimage {
    width:100px;
    position:fixed;
    top: 0px;
    left: 0px;}

    #rightimage {
    width:100px;
    position:fixed;
    top: 0px;
    right: 0px;}

    #middle-col {
    width:950px;
    }

    in style.php but When I do so Image appears above logo above logo after footer...

    The main body width is 950px and each of images I am trying to add is 100px.

    What am I doing wrong? Can anyone help?

    Thanx in advance guys :)
     
    loukaselessar, Jun 23, 2012 IP
  2. Blue Star Ent.

    Blue Star Ent. Well-Known Member

    Messages:
    1,989
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You are writing for the style sheet. PHP begins with → <?
     
    Blue Star Ent., Jun 23, 2012 IP
  3. loukaselessar

    loukaselessar Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So, what am I doing wrong?
     
    loukaselessar, Jun 25, 2012 IP
  4. cons1t

    cons1t Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    You can prevent an element from scrollng by using CSS position fixed.
    
    davidwalsh.name/dw-content/css-fixed-position.php
    <style>
    position:fixed;
    top: 2%;
    right: 2%;
    </style>
    
    Code (markup):
     
    cons1t, Jun 25, 2012 IP
  5. DreamsMaker

    DreamsMaker Well-Known Member

    Messages:
    74
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    120
    #5
    float: left; //for left image
    float: right; //for right image
     
    DreamsMaker, Jun 25, 2012 IP
  6. loukaselessar

    loukaselessar Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you for your help guys but no matter whatever I do my image keep staying on top of main body and does not go floating left or right in the empty spaces left and right of main body. I even tried Cons1st example but still no luck. Can you give me code for placing images left and right height 700px and width 100px. like

    <div id="leftimage">float: left; //for left image
    <a href="http://www.domain.com"><img
    src="http://www.domain.com/test.jpg" /></a>
    </div><!--/leftimage>
     
    loukaselessar, Jun 28, 2012 IP