Solved

CSS, DIV, Fieldset

Posted on 2014-02-09
8
605 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
  • 5
  • 3
8 Comments
 
LVL 52

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 30

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 52

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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 30

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 30

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 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 500 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 30

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 30

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Target h5 of a div 3 16
Divi Theme - extra fonts I don't want 13 23
Add box and text color changing for everything 1 23
If condition on Html with Asp 11 11
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

813 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

10 Experts available now in Live!

Get 1:1 Help Now