?
Solved

CSS, DIV, Fieldset

Posted on 2014-02-09
8
Medium Priority
?
640 Views
Last Modified: 2014-02-14
Hello all;

I am trying to get something to work.
Below is the example code.

The id="CenterText"
Needs to NOT push the lines 1,2,3 down on the side, but to be able to grow
Without effecting anything around it.
I have something out of place, I am just not sure what or which one it is.

Here is the code.
<fieldset style="width:800px;">
<legend><span>this is my place</span></legend>
<div>
<span style="border:1px double #000;">to the left</span>
<span style="float:right; border:1px double #000;">to the right</span>
</div>
            
 <div>name(<span title="name">my name</span>)</div> 

<div>
<!--This needs to be in the middle, and as it grows, the sides do not expand, as they are doing now.
lines 1,2,3 are below, when they should be staying steady underneath the (name) -->
<div align="center" id="CenterText">
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
</div>


<div>1st line</div>				
<div>2nd line</div>
<div>3rd line</div>
</div>

</fieldset>

Open in new window


Thanks All
Carrzkiss
0
Comment
Question by:Wayne Barron
[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
  • 5
  • 3
8 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39846381
Perhaps add a height and overflow scroll http://jsbin.com/kesor/1/edit?html,output
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <style>
    #CenterText{height:75px;overflow:scroll;}
    
  </style>
</head>
<body>
  <fieldset style="width:800px;">
<legend><span>this is my place</span></legend>
<div>
<span style="border:1px double #000;">to the left</span>
<span style="float:right; border:1px double #000;">to the right</span>
</div>
            
 <div>name(<span title="name">my name</span>)</div> 

<div>
<!--This needs to be in the middle, and as it grows, the sides do not expand, as they are doing now.
lines 1,2,3 are below, when they should be staying steady underneath the (name) -->
<div align="center" id="CenterText">
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
  information here<br/ >
  information here<br/ >
</div>


<div>1st line</div>				
<div>2nd line</div>
<div>3rd line</div>
</div>

</fieldset>
</body>
</html>

Open in new window

0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 39846427
Hey Scott.
That will not work.
It is for posting comments, and to have an overflow scroll, would look to messy and unprofessional for this site.

The original code was built with a Table.
However, I am trying to step away from using Tables in this site, if possible.
Some area's will have them, but this area, I am hoping to completely remove tables all together.
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39846433
I guess I don't understand your question then.  How can you add content without pushing the bottom down unless the bottom is perhaps a sticky footer?

We could put the "information here<br/ >" into div's that are floated left and they will form columns but at some point it will wrap and then push down the <div>1st line</div>.

Can you point to a test url for the way you are doing this now.
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.

 
LVL 31

Author Comment

by:Wayne Barron
ID: 39846434
Getting there.
The only thing, is that if the text is longer, like what is written on this line right here, that you are reading.
Then it breaks the lines on the side.
So I need to find a way to make it not cross over to the left side, so I tried.
width:75%;
And that did not work.

Here is the updated code, and semi works.

<fieldset style="width:800px;">
<legend><span>this is my place</span></legend>
<div style="background-color:#666; color:#FFF;">
<span style="border:1px double #000;">to the left</span>
<span style="float:right; border:1px double #000;">to the right</span>
</div>
            
 <div>name(<span title="name">my name</span>)
 
 <!--This needs to be in the middle, and as it grows, the sides do not expand, as they are doing now.
lines 1,2,3 are below, when they should be staying steady underneath the (name) -->
 
 <span style="float:right; margin-right:50%;" id="CenterText">
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
information here<br/ >
</span>
 </div> 

<div>

<div><span>1st line</span></div>				
<div>2nd line</div>
<div>3rd line</div>
</div>

</fieldset>

Open in new window

0
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 0 total points
ID: 39846451
I think that I have it!!!!!
The text does not break the side now.

<style type="text/css">
.Setwidth{
	min-width:590px; 
	width:100% !important;
}
</style>

<fieldset class="Setwidth">
<legend><span>this is my place</span></legend>
<div style="background-color:#666; color:#FFF;">
<span style="border:1px double #000;">to the left</span>
<span style="float:right; border:1px double #000;">to the right</span>
</div>
            
 <div>name(<span title="name">my name</span>)
 
 <!--This needs to be in the middle, and as it grows, the sides do not expand, as they are doing now.
lines 1,2,3 are below, when they should be staying steady underneath the (name) -->
 
 <span style="float:right; margin-right:1%; width:80%;" id="CenterText">
information hereinformation hereinformation hereinformation hereinformation hereinformation herehereinformationherehereinformationherehereinformationherehereinformation
information hereinformation hereinformation hereinformation hereinformation hereinformation herehereinformationherehereinformationherehereinformationherehereinformation
information hereinformation hereinformation hereinformation hereinformation hereinformation herehereinformationherehereinformationherehereinformationherehereinformation
information hereinformation hereinformation hereinformation hereinformation hereinformation herehereinformationherehereinformationherehereinformationherehereinformation
</span>
 </div> 

<div>

<div><span>1st line</span></div>				
<div>2nd line</div>
<div>3rd line</div>
</div>

</fieldset>

Open in new window

0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 2000 total points
ID: 39846467
I would have done this a little different and  use divs since those are already blocks.
<style>
#container{width:800px;}
#names{width:200px;float:left;margin-right:10px;}
#information{width:580px; float:left;}
</style>
<div id="container">
   <div id="names">
         <div>name 1</div>
         <div>name 2</div>
         <div>name 3</div>
    </div>

    <div id="information">
              hereinformation hereinformation hereinformation hereinformation
     </div>
</div>

Open in new window


The above code is not responsive but you could just as easily use % instead of px.  You should really take a look at using a grid and I like bootstrap http://getbootstrap.com/css/.  Since you are moving from tables to divs, this really makes sense.  Bootstrap is a responsive grid and can help you manage desktop and mobile.  When designing responsive pages, you just have to think through more than normal as to how the page looks on each screen size.  You can make bootstrap not responsive as well.  An alternative is http://www.blueprintcss.org/ which is just the css and not all the fancy stuff.  I used to use blueprint a lot and now mostly bootstrap.
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 39846480
Thanks Scott.
The reason why I used what I did, is it is already setup on the site, for the user-eye-candy that I am using, and need to continue using it as well.
The layout you showed, works great, just not for what i am doing right now.

As for the Bootstrap, that looks really good, however, not what what I am working on at this moment.
However, maybe in the future, as I have a lot of projects in the works for 2014, that it might just come in handy for.

I am going to close this one out.
Accept my last code as Answer, and give you the points for your last post.
As it is very informative.

Have a good one Scott.
Wayne
0
 
LVL 31

Author Closing Comment

by:Wayne Barron
ID: 39858554
I figured out my issue on my own, as listed in the accepted answer.
To Scott, thanks as always, for the great advice.
It will come in very handy sometime in a future 2014 project.

Wayne
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

800 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