|
|
How Do I Make A Box To Surround My Text? | ||
Discussion by lonebyrd with 11 Replies.
Last Update: September 11, 2006, 1:45 am | |||
Fri Sep 8, 2006 Reply New Discussion
CODE
.box {
width: auto;
height: auto;
border: 1px solid #FFFFFF;
text-align: center;
}
You have to use an altered one, where, instead on just one 'border' property for all the borders, you can have for specifics:
CODE
.box {
width: auto;
height: auto;
border-top: 1px solid #FF0000;
border-bottom: 1px solid #00FF00;
border-right: 1px solid #0000FF;
border-left: 1px solid #FFFF00;
text-align: center;
}
Here ofcourse, I have chosen colours to be all different (red, green, blue and yellow - in that order), but that is just for illustration. What you could do was, if you had the box with background colour of blue, for the top and left, choose a light blue colour, for the right and bottom, choose a dark blue colour. That would give the effect as if the box was embosed and there was a source of light at top-left.
The choice of colours for seperate borders may also be used for other design methods.
Fri Sep 8, 2006 Reply New Discussion
Sat Sep 9, 2006 Reply New Discussion
If you want to align the text either left or right, you can just use the text-align attribute and apply it to whichever block of text you want, like this:
CODE
<div class="left"></div>First create the class and call it what you please...
Then in the CSS code, you can label the class with:
CODE
div.left {
text-align: left;
}
Other attributes for text-align are right, center and justify.
I guess if you wanted to have the next 3 lines 10 spaces in you could always specify a blockquote, like this:
<blockquote>your text here</blockquote> Then you can use CSS to decorate the blockquote to suit your needs (i.e. add a border on the left to show its indentation or something. Then for your submit regions to be aligned right you can add another <div class="right"></div> and then specify styles for that. I suppose if you wanted you could do the same with a <p class="left"></p> if you don't want to use <div>s in your form.
Sat Sep 9, 2006 Reply New Discussion
Just the div code in my page
CODE
<div class="box">
Conformation Page</br>
</br>
<span class="space1">You Have Chosen: Public Access - Level 1</span></br>
<span class="space2">You are allowed: 1 Set</span></br>
<span class="space3">4 Crew</span></br>
<span class="space4"> Advertisments</span></br>
<span class="space5"> Total Cost: $$$$$$$</span></br>
<span class="space6"> Do you want to continue with this transaction?</span></br>
<p align="right">
<FORM METHOD="LINK" ACTION="http://www.ftv.astahost.com/buy/station/confirm1.html">
<INPUT TYPE="submit" VALUE="Yes">
</FORM>
<FORM METHOD="LINK" ACTION="http://www.ftv.astahost.com/buy/station/filter.html">
<INPUT TYPE="submit" VALUE="No">
</FORM>
</align>
</div>
CSS
CODE
.box {width: auto;
height: auto;
border: 1px solid #FF0000;
padding: 2px;
margin: 2px;
}
.space1 {
padding-left: 5px;
}
.space2 {
padding-left: 5px;
}
.space3 {
padding-left: 15px;
}
.space4 {
padding-left: 15px;
}
.space5 {
padding-left: 5px;
}
.space6 {
padding-left: 20px;
}
Does anyone see what is wrong??
Sat Sep 9, 2006 Reply New Discussion
From what you've written, Table in the center of the page, with a colour, 3D borders - can be sorted out with something like this:
CODE
<TABLE WIDTH = "200" HEIGHT = "100" ALIGN = "center"BGCOLOR = "blue" CELLPADDING = "2" BORDER= "3"
BORDER-STYLE = "ridge">
<TBODY>
<TR>
<TD>
<CENTER>
<Font Color = "White" SIZE = "5">Hope this works
out for you..!!</FONT>
</CENTER>
</TD>
</TR>
</TBODY>
</TABLE>
Placed in a web page, what this will instantly do is give you a box in the middle of the page with a width of 200 px a height of 100 px; gives you a 3D border (you can get into more detailing with the border properties).. You've got a blue background with the writing int he center and sized to 5.
When you make a table - you need to keep in mind that you need to use the TBODY (shows the start of the body of the table, the TR (to designate the start of a row) and the TD attribute which will tell the system that there is a bit of data (like maybe some text or an image). Of course, if you get into detailing some more there are a huge many possibilities to getting your tables just as you want them.
Sat Sep 9, 2006 Reply New Discussion
As for your code, lonebyrd, first I have a few suggestions.
1. In the HTML code, use all lowercase letters
2. Don't put numerous spaces after that <span> tag, as it will be seperated by the CSS
3. Always use relative URLs, in case you change the web site address (i.e. get a domain)
I don't really see the problem, since it's working (rather) fine for me. I don't know what exactly what you want, but the only real problem I can see is the box width. Auto/nothing obviously sets it to 100%, so you ought to use width: 300px, or some other value. And yeah, you also closed the <p> tag with </align> instead of </p>
Anyway, if you can draw what you want in Photoshop, I'd be more than glad to make it myself, since that way I improve my skills.
Sat Sep 9, 2006 Reply New Discussion
Sun Sep 10, 2006 Reply New Discussion
So, for testing purposes, use Firefox, since it interprets the CSS code properly. After you're done tweaking your site, fire up IE, and see what is being displayed as it should be. IE has always had problems with CSS, so you will probably need to modify the CSS file so the site looks the same in all browsers.
Sun Sep 10, 2006 Reply New Discussion
Another thing, if you download the FF browser, also download the Web Developer Extension for it. There are some pretty handy features included with it. Check it out.
Sun Sep 10, 2006 Reply New Discussion
Mon Sep 11, 2006 Reply New Discussion
CODE
<link href="style.css" rel="stylesheet" type="text/css" />Also, you will need to create a file named "style.css" and put it in the same folder as the pages. Now, write the following code in that CSS file (or the existing file, if there is one).
CODE
.box {width: auto;
height: auto;
border: 1px solid #FFFFFF;
text-align: center;
}
Now to explain the attributes. Width and height define the box size. It it's on auto, it will "wrap" around the text. You could also write "150px" instead of "auto". Next is the border. You can define its thickness (1px), style (solid - simple line, dotted, dashed etc.) and the colour (#FFFFFF - black). Text-align is obviously used to align the text. There are four options - left, center, right and justify. There are also numerous other attributes that can define a CSS class.
In order to use this with you text, instead of putting <fieldset>, write <div class="box">TEXT GOES HERE</div>.
As for the spaces problem, it can also be solved through CSS. In the CSS file add this text.
CODE
.space1 {padding-left: 20px;
}
.space2 {
padding-left: 30px;
}
The padding-left attribute tells the broser to move the text X pixels from the left border. Again, you can use any value you like. And how is this used? Easily. This would be a piece of text with 20px padding for the 3rd line, and 30px for the fifth.
CODE
<div class="box">This is the line number one text.<br />
This is the line number two text.<br />
<span class="space1">This is the line number three text.</span><br />
This is the line number four text.<br />
<span class="space2">This is the line number five text.</span><br />
This is the line number six text.
<div>
Hope this helps.
Fri Sep 8, 2006 Reply New Discussion
Searching For A Good Drop-down Menu Script (1)
|
(1) Shoping Card
|
Index




