Solved

Horizontally centering an inline frame

Posted on 2011-09-20
5
216 Views
Last Modified: 2012-05-12
Hello experts,

Does anyone know how to center an inline frame? To put it into context, I'm trying to center the Amazon aStore inline frame I have on my website. I can't extend the website border out because it's a GoDaddy template. The web page I'm trying to do this on is http://www.snowboarding-jackets.net/Store.html, and as you can see the inline frame blocks out some of the content on the right because it opens on the left. I have a scroll bar at the bottom but that isn't ideal. If there is another way to show the whole shop on the page then I'm all ears.

I eagerly await your advice.

Cheers.
0
Comment
Question by:MaxP0wers
  • 2
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 250 total points
ID: 36572149
give some negative padding to the left of wrapping div
0
 
LVL 9

Expert Comment

by:user_n
ID: 36572439
Try http://astore.amazon.com/snowboarding-jackets-20 line 183
from   padding-left: 4px; to   padding-left: 2px;

div#searchbrowse {
    padding-bottom: 14px;
    padding-left: 2px;
    padding-right: 14px;
    padding-top: 14px;
}
0
 

Author Comment

by:MaxP0wers
ID: 36572575
Thanks guys, I follow what your saying mostly, but am unsure on exactly how to do what your saying. Could you please dumb it down a bit as I'm not too experienced with code. Especially when using CSS in combination with HTML as I have little, next to no experience with CSS.

Could you talk me through the process of adding this code in more detail please.

Thanks for the help :)
0
 
LVL 9

Expert Comment

by:user_n
ID: 36572615
change in your source
/* SEARCHBROWSE WIDGET */
div#searchbrowse {
      padding:14px;
}


to

/* SEARCHBROWSE WIDGET */
div#searchbrowse {
       padding-bottom: 14px;
    padding-left: 2px;
    padding-right: 14px;
    padding-top: 14px;
}
0
 

Author Comment

by:MaxP0wers
ID: 36578830
Oh gotcha. Works great but creates one more problem. How do I source the new code and the url for the amazon aStore? The links in the aStore are all dead when I create the new script as it's not sourced straight from Amazon. The HTML code I have for the new one is:

<img alt="" uid="d6522d45-827d-454e-804c-22f38cc0b7f2" src="http://img1.wsimg.com/wst/old/ftb/images/utility/ss_kvk9LoefFL4BS-2F3rS95PzZG3w_gn3bS2z4ywE.gif" class="script" />

Open in new window


With the amazon affiliate url inserted into the 'src' part:

http://astore.amazon.com/snowboarding-jackets-20

Open in new window


This is the original code I had:

<iframe width="100%" scrolling="auto" height="980" frameborder="0" align="middle" src="http://astore.amazon.com/snowboarding-jackets-20"></iframe>

Open in new window


Sorry but I'm quite new to all of this so I'm a bit slow with all the lingo.

Cheers
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now