Solved

Image at the side of the div

Posted on 2011-03-13
8
222 Views
Last Modified: 2012-08-13
Hi,

Wondering what is the best way of positioning an image so it as at the edge of my div and looks to be on the outside almost like a bookend. I currently have all my divs centered. Any thoughts.

A div on the outside,  div with a minus margin?
0
Comment
Question by:wilflife
8 Comments
 
LVL 7

Expert Comment

by:wdfdo1986
ID: 35121412
can u give me some design of what u need?
I cant understand what u need.
0
 

Author Comment

by:wilflife
ID: 35122871
central div with all the content, to the top and on the outside of the div central div an image as if on the outside of the content. Hmm put this in the wrong group i think. Should have been css, html etc.
0
 
LVL 12

Expert Comment

by:Amick
ID: 35122980
Are you looking for a similar effect to what http://www.bergamotus.ws/samples/3column-stretch-with-borders.html shows with the navigation and sidebar areas bearing images that bracket the content area?  If so, the source code provided at that link will offer a great starting point.
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35123141
Hi,

It is hard to understand what you really need, maybe a mock-up image would help.
However, when we talk about positioning I think jQuery position from the UI would help. Anyway, this could also be done using CSS but I will need more details.

---------------------------
You can find me on - Deveolopment Solutions: www.extremedev.blogspot.com
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:wilflife
ID: 35130253
So i guess the closest i have to what i want is the following site:

http://pikachoose.com/

The image is on the outside of the main content area.
0
 
LVL 9

Accepted Solution

by:
Roman Gherman earned 500 total points
ID: 35131938
Hi,

Well actually the link that you have provided does not any divs moved outside another div element - it is just images and dives arranged so that it looks like but actually it is not.

However here is an example of what you needed - as I said - using jQuery UI position():
<head>

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

    <title></title>
</head>
<body>
    <center>
        <div id='mainDiv' style="width: 350px; height: 400px; background-color: Yellow">
            TESTTESTTESTTESTTESTTESTTEST TESTTESTTESTTESTTESTTESTTEST TESTTESTTESTTESTTESTTESTTEST
            TESTTESTTESTTESTTESTTESTTEST TESTTESTTESTTESTTESTTESTTEST TESTTESTTESTTESTTESTTESTTEST
        </div>
        <div id='outDiv' style="width: 100px; height: 100px; background-color: Maroon;">
            TEST OUT</div>

        <script type="text/javascript">
            $('#outDiv').position({
                my: 'center center',
                at: 'right top',
                of: '#mainDiv',
                offset: '-20 10'
            });

        </script>
    </center>
</body>
</html>

Open in new window


---------------------------
You can find me on - Deveolopment Solutions: www.extremedev.blogspot.com
0
 

Author Comment

by:wilflife
ID: 35175136
Architecturally which is the best way of doing it as they have or using your solution?

Thanks.
0
 
LVL 9

Assisted Solution

by:Roman Gherman
Roman Gherman earned 500 total points
ID: 35178515
Hi,

In my opinion it is better to use tables as these are more stable than div elements.

Row1- Header + COLSPAN
Row2 - Content
Row3 - Footer + COLSPAN

and if you need to achieve what they have - you just make it in the way they did -  put the image as a background and then put your text on top.

But if you don't need text then just put it as image.

It's easy.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

16 Experts available now in Live!

Get 1:1 Help Now