8 replies [Last post]
sinnerman
sinnerman's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-16
Posts: 5
Points: 8

Hi Folks!

So I just finished creating my first wordpress theme, applied it to the site and is all good save for one thing, in the footer I put some small copyright text and I need it to position itself on the right side of the line, so I'm using a SPAN tag to do that, but when I used the following code, the text goes all the way to the right of the browser window, instead of staying in the fixed width page wrap DIV, Code pasted below:

I tried this first:

span.right {
  position: absolute;
  right: 0;
}

but since it spilled out of the page wrap div, I now am using this:

span.left {
  position: relative;
  left: 355px;
}

Only problem with the above is that it works in chrome and safari, and to some extent in firefox, but in opera it gets misaligned.

Here's the code for my footer.php:

<div id="footer">	
Tel 604.253.1451 <a href="mailto:wendyd@wendyd.ca">wendyd@wendyd.ca</a> <span class="left"><small>All content is &copy; <?php print(date(Y)); ?> by <a href="<?php echo get_option('home') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name'); ?></a>. All rights reserved.</small></span>
</div>	
	<div class="clear"></div>
 
</div> <!-- END main-content -->
 
</div> <!-- END page-wrap -->
 
 
</body>
 
</html>

And lastly, the live website: http://www.wendyd.ca/

What am I doing wrong?

Tyssen
Tyssen's picture
User offline. Last seen 1 day 21 hours ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8140
Points: 1322

Did you edit your HTML? I

Did you edit your HTML? I don't see a span.right.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

sinnerman
sinnerman's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-16
Posts: 5
Points: 8

Thanks for the response,

Thanks for the response, that is what I was using first, but it was making the copyright show up on the extreme left, touching the edge of the browser, and not inside the 616px wide div page wrap that I've set.

Tyssen
Tyssen's picture
User offline. Last seen 1 day 21 hours ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8140
Points: 1322

So... is there still a

So... is there still a problem or are you all good now?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

sinnerman
sinnerman's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-16
Posts: 5
Points: 8

Sorry, I haven't been really

Sorry, I haven't been really clear.

My question in the end is, if I use the following code to make the copyright text appear on the right, why does it not stay inside the 944px wide box created by the DIV page wrapper? It goes all the way to the edge of the browser window, on the right.

span.right {
  position: absolute;
  right: 0;
}

Here is what it looks like: Overflow

Deuce
Deuce's picture
User offline. Last seen 4 weeks 5 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

The HTML posted above doesn't

The HTML posted above doesn't have anything in it with a class of 'right'...

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

sinnerman
sinnerman's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-16
Posts: 5
Points: 8

Deuce wrote: The HTML posted

Deuce wrote:

The HTML posted above doesn't have anything in it with a class of 'right'...

Correct, that is because I am not using that code, it messes up like the image I posted in my previous response, so instead I had to use this:

span.left {
  position: relative;
  left: 355px;
}

The problem with the above code is that every browser interprets 355px differently, it works fine in Chrome and Safari but sticks out with opera and lands short in Firefox.

Tyssen
Tyssen's picture
User offline. Last seen 1 day 21 hours ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8140
Points: 1322

Add position: relative to

Add position: relative to #footer to establish a new positioning context (i.e. positioned elements take their coordinates from #footer and not from the window).

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

sinnerman
sinnerman's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-16
Posts: 5
Points: 8

Woohoo

That did it! Thank you so much Tyssen!

Cheers Big smile