Solved

CSS positioning a certain image in a certain region

Posted on 2014-07-18
11
159 Views
Last Modified: 2014-07-21
Hi there!

The image (attached) shows the problem: I would like to have the official solution of problem 1 presented inside the "Suggested Solution" area, even when no text is typed in this area. (When text is typed, the width of this region gets larger and the figure is shown without going over the next regions.)

Trying to solve the issue, I created a certain div to deal with the CSS of the image-holder specifically:

#questimageAnalysis {
      clear: both;
      width: 700px;
      float: right;
      padding-bottom: 100px;
}

and you can see this put into use here:

<div id="questimageAnalysis">
      <img src="../.../etc" alt="" name="Image3" id="Image3" />
      </div>

When I change the float to "left" it acts as expected, therefore the problem must be related to the CSS itself.

Please help!

P.S.: don´t worry about the links ("update ExplanationContent" and "update ExplanationContent Math")... they have nothing to do with the problem.
CSS-error.gif
0
Comment
Question by:fskilnik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 40204463
Link please.

If you don't have this public, strip out anything private and make a test case that can be made public.  If you still can't do that, you can use jsbin, jsfiddle, codepen and many others to create a test case to look at.

Thank you.
0
 

Author Comment

by:fskilnik
ID: 40204755
Hi, Scott.

Your demand is more-than-deserved. I will prepare a test-page with only what really matters contained (all div´s, for sure), and will be back with the link (still today).

Thank you for your support and see you soon!
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 40204780
Thank you.
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

Author Comment

by:fskilnik
ID: 40204850
Here we are:  

http://www.gmath2.com/Internal/admin_Materials/test.asp

(The page is not exactly the one shown before, but the problem is exactly the same. I took out the div related to the image because it didn´t work as expected.)

P.S.: the link below shows what I would like to get, but of course without having to type anything. (a, b, c were typed just to be able to see the image in the place it should be!)

http://www.gmath2.com/Internal/admin_Materials/test2.asp
0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 40204955
It is a bit confusing what you want.  I think you mean to add some height.

outside_question #question {
border-top-width: 1px;
border-top-style: solid;
border-top-color: #FFD2A6;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #FFD9B3;
padding-top: 20px;
padding-right: 10px;
padding-bottom: 0px;
padding-left: 10px;
/*  *******  HEIGHT ADDED ***** */
/* or you can use min-height:150px;  */
height: 200px;
}

Open in new window

0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 40204962
I don't know how far in you are with your project, but I see you are using spry. Adobe has abandoned that project and you should really use something more modern like jquery or one of the other js libraries. http://todomvc.com/
0
 

Author Comment

by:fskilnik
ID: 40205342
Hi, Scott.

Thank you very much for your posts on this matter. I must leave the office now, but I will be back this Sunday. At that time I will look into your suggestions carefully and write you back!

Have a great day/weekend!
fskilnik.
0
 

Author Comment

by:fskilnik
ID: 40209210
Hi, Scott.

I am sorry for my delay, but yesterday (Sunday) I stayed at home (because of a terrible backache, not fully recovered yet...).

Your  "min-height: 150px; height: 200px:"  idea solved the problem for that image (therefore you understood what I need),  but the fact is every image has a different height, therefore there must be some other CSS-property that is able to "tell" the area in which the image is contained that it must "wait to the image to finish" so that it can close itself right after that (with same extra margin/padding between them, but this is easy).

As far as the "spry thing" is concerned, thank you for the warning. I put the spry in a clever way (not linked to an external - and now non-existent - source), but I guess it will be wiser to avoid it and give preference for jQuery, for instance.

Still waiting for another CSS-property, then!

Thanks  lot,
fskilnik.
0
 

Author Comment

by:fskilnik
ID: 40209282
I´m back, Scott.

I could find a solution (closely related to your idea!) in page 295 of the great book "CSS  The missing manual" by David S. McFarland. He mentioned it as the "easy clearing method" created by Tony Aslett of CssCreator.com.

I guess you´ve already know this, but, anyway, it is as follows:

You create 3 different styles (shown below) and, at the end, you include the [class = "clear"] to the div containing the "escaping float", in our case the [outside_question #question] one, as you correctly suggested.

Best Regards and see you in my next EE posts, I hope!
fskilnik.

.clear:after {
      content: ".";
      display: block;
      height: 0;
      font-size: 0;
      clear: both;
      visibility: hidden;
}

.clear {
      mini-height: 1px;
}

* html.clear {
      height: 1px;
}
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 40209292
I don't have a lot of time today.  I think your html may be a little over complex.    Look at this easy sample and see if it helps.

I have 3 div's floated and set the min-height to 50px and placed an image that is 150px tall inside.  It seems to do the trick.  

http://jsbin.com/nayoyi/1/edit
<!DOCTYPE html>
<html>
<head>
  <style>
    .one{
  float:left;
  width:300px;
  padding:10px;
  min-height:50px;
  border:solid thin
  
  
}
    </style>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div class="one left"></div>
   <div class="one mid"><img src="http://placehold.it/350x150"></div>
   <div class="one right"></div>
</body>
</html>

Open in new window

0
 

Author Comment

by:fskilnik
ID: 40209308
Very nice, Scott!

It does the trick and, in fact, in a much easier way.   :)

Thanks a lot!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

688 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