![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 6
Rep Power: 0
![]() |
Aligning text
This is just about as noobie of a question as it gets... I want to create text so that some is on the left and some is on the right of the same line. Eventually, I'll be making them links to the previous and next pages of a manual-type document. This is what I tried to do:
<HR><H3> <DIV ALIGN="left"><< Previous</DIV> <DIV ALIGN="right">Next >></DIV> </H3><HR> </BODY></HTML> It turned out so that they were on the left and right sides, though the "Next >>" text was one line below the "<< previous" text. I'm just learning to code HTML and so far have just read "Learning HTML in 14 days" (written in 1997, which I wish I would have realized sooner...) so any advice on references of what has happened to HTML in the past decade would be of help to me. (Will move up to DHTML after I get a bit of practice with HTML.) |
|
|
|
|
|
#2 | |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
<div>s are block level elements, hence the line break.
Use <span>s and float them. <hr /> <h3> <span style="float:left;"><< Previous</span> <span style="float:right;">Next >></span> <div style="clear:both;"></div> </h3> <hr /> Quote:
of HTML and JavaScript to make annoying and distracting things happen on the page - It is XHTML you should be learning. ![]() There are plenty of resources out there. Just google for 'HTML Tutorials' or something. w3Schools is, as always, a good place to start. Here's some links you might find useful: http://www.w3.org/QA/2002/04/valid-dtd-list.html http://validator.w3.org/ http://www.westciv.com/style_master/...l/dead_layout/ http://www.hotdesign.com/seybold/index.html http://www.w3schools.com/css/default.asp http://glish.com/css/ http://www.bluerobot.com/web/layouts...horizdropdowns http://www.quirksmode.org/css/condcom.html
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2006
Posts: 6
Rep Power: 0
![]() |
The <span> tag works. Thank you.
<span> was never mentioned in the '97 book, but I'll be looking it up along with the references you suggested. So thanks again. |
|
|
|
|
|
#4 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
Dump the '97 book. The web's moved on to XHTML/CSS.
I recommend W3schools, it's where I learned. By the way, is there a way to get text in the middle of that line without assuming the font-size on the browser is a typical font size?
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
Just apply text-align to the <h3>
<hr /> <h3 style="text-align:center;"> <span style="float:left;"><< Previous</span> <span style="float:right;">Next >></span> This should be in the middle. <div style="clear:both;"></div> </h3> <hr />
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
#6 |
|
King of Portal
|
Here's another way though not as efficient I suspect.
<HR><H3> <table border="0" width="100%"> <td align="left"><< Previous</td> <td align="right">Next >></td> </table> </H3><HR> </BODY></HTML>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
It's got nothing to do with efficiency, grim. Tables are for displaying
tabular data. What about this data is tabular?
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
#8 |
|
King of Portal
|
Absolutely nothing, I use tables as a grid-like interface for visual formatting, not just for tabular data. I concur that you are correct though, in the strictest sense, tables are exclusively for tabular data. However, my pirate creed forces me to use and abuse all HTML tags at my whimsy ahahahaha. Just check my website for an example *_*
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [perl] graphical text editor | glimmy | Existing Project Development | 0 | Aug 6th, 2006 11:47 PM |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| Basic HTML Tutorial - Reuben Keeney | ReubenK | HTML / XHTML / CSS | 14 | Mar 26th, 2006 5:50 AM |
| How to detect cursor location and insert text??? | syntax-error | C# | 3 | Jun 30th, 2005 1:42 AM |