Lozbo
Sep 20 2005, 09:45 PM
| | We all remember the good old tables right? When we used them to design or beloved websites. But nowadays things have change a little bit, strict code format, css, xhtml and no tables.
And so when it comes finally to the design of a form, instead of having two rows (left row with the label and right row with the input tag) and those rows aligned to look nice (left row= right aligned and right row=left aligned), how can we keep order with our fancy style sheet?
Thanks in advance. |
Reply
rvalkass
Sep 21 2005, 06:38 PM
I was having a look at this earlier today. This is the CSS I ended up using. It probably isn't perfect, but I got it to work. CODE div.line { clear: both; padding-top: 10px; }
div.line span.text { float: left; width: 120px; text-align: right; }
div.line span.input { float: right; width: 350px; text-align: left; }
Then put each line within a <div class="line"></div> Each text label goes inside the div, between span tags, class "text". Each input of the form goes between span tags with a class of "input". e.g. HTML <form> <div class="line"> <span class="text">Username:</span><span class="input"><input type="text" size="25"></span> </div> <div class="line"> <span class="text">Password:</span><span class="input"><input type="password" size="25"></span> </div> </form>
Hope this helps you.
Reply
Lozbo
Sep 21 2005, 09:46 PM
Thanks! It does help. Actually i had already thought something like that, but never tried. Additionally, isnt there an easier way to do this? To float all p to the right and all input to the left, I dont know how but i mean to avoid having to put inside a div each line of stuff... I think you understand me... just an easier way. I mean i thank rvalkass, i do find this helpful, im just asking hehe:)
Reply
Tyssen
Sep 22 2005, 03:56 AM
A better way to do it is to use the <label> tag cos that tag gives a label to each field (good for people with screen readers too). Here's an example of a form I've done: CODE <label for="Name"><span>Name:</span> <input type="text" name="Name" id="Name" maxlength="100" value="" /> </label> <label for="Phone"><span>Phone:</span> <input type="text" name="Phone" id="Phone" maxlength="15" value="" /> </label>
label { clear: left; margin-bottom: 5px; } label span { float: left; width: 120px; margin-right: 10px; } input { padding: 2px 0; margin-bottom: 5px; width: 200px; font-size: 85%; color: #660000; vertical-align: middle; border: 1px solid #660000; }
Reply
arboc7
Sep 22 2005, 04:30 AM
QUOTE(Tyssen @ Sep 21 2005, 10:56 PM) A better way to do it is to use the <label> tag cos that tag gives a label to each field (good for people with screen readers too). Here's an example of a form I've done: CODE <label for="Name"><span>Name:</span> <input type="text" name="Name" id="Name" maxlength="100" value="" /> </label> <label for="Phone"><span>Phone:</span> <input type="text" name="Phone" id="Phone" maxlength="15" value="" /> </label>
label { clear: left; margin-bottom: 5px; } label span { float: left; width: 120px; margin-right: 10px; } input { padding: 2px 0; margin-bottom: 5px; width: 200px; font-size: 85%; color: #660000; vertical-align: middle; border: 1px solid #660000; }
I was about to say...why use the excess <span> tags when you can use <label> tags, and besides, using <label> tags makes your script more geared toward semantic markup...
Reply
Lozbo
Nov 23 2005, 10:09 PM
And is there a way of doing this without any span? just label and input floats? A way of selecting through the cointainer div and tell the form, the fieldset or whatever to float some where or something?
Reply
Tyssen
Nov 23 2005, 10:20 PM
I'm not aware of a way to do it without using spans. All the CSS-driven forms I've seen have done it that way. If you want to see a souped-up CSS tableless form, check out this.
Reply
arboc7
Nov 23 2005, 11:59 PM
Thanks for the link Tyssen, that's a really nice form! Thanks again...
Reply
Lozbo
Nov 25 2005, 01:52 AM
Yeah cool, im glad at least that theres a way to get a tableless way to do it, though if some one knows how to do it without spans or divs i'll apreciate, though im really happy with my brand new fancy tableless design... like someone said: "Look ma... no tables!"... hehe, heard it somewhere...
Reply
Recent Queries:--
xhtml form css - 24.38 hr back. (1)
-
xhtml form width - 28.60 hr back. (1)
-
xhtml forms layout - 50.04 hr back. (1)
-
valid xhtml form layout - 62.55 hr back. (1)
-
html form layout xhtml - 73.88 hr back. (1)
-
class - 79.09 hr back. (1)
-
xhtml form - 41.75 hr back. (2)
-
strict xhtml/ css form layout - 121.41 hr back. (1)
-
css reply form layout - 169.94 hr back. (1)
-
layout xhtml forms with css - 173.15 hr back. (1)
-
xhtml layout naming - 182.36 hr back. (1)
Similar Topics
Keywords : xhtml, forms, layout, standars
- Opening Hyperlink In New Window Using Xhtml 1.0 Strict
(5)
Centered Div Layout Issues
Float Right item not vertically aligned with text (2) Hey everyone. I am writing an all div layout for my friends website and i just cant seem to get all
the fields aligned properly. I can get all my images to be aligned and look great until i put any
text on the site. For example, my box that will contain links and such has 3 parts: top, middle and
bottom. Each of these have 3 parts: left, middle and right. To program the 3 parts of each row, i
use 3 divs which are all floated based on their position. However, as soon as I put text in the
middle area, the right image is moved down to a new line. The sample site is located ....
Dynamic Forms Help - How Do I Create These?
(8) Hi I have a page with a form with some input fields. When it is submited it goes to the comfirmation
page. I want the form to have an input / button where if the user can enter/add more fields for
input. i.e or --> (update this form with more input fields) -->
(submit to confirm.php) I want the user to be able to enter a value or have a button to be able
to add more fields. I've tried searching the web but havent been able to find anything that
works.....
Xhtml Strict Links Tip
A problem might accure (5) If you try to put a link that has an & in your xHTML strict page, you need to change & to & in
order for the page to be xHTML Strict.. eg.. BAD LINK: CODE
http://jasamza.korisnik.com/forums/viewtopic.php?f=19&t=7&sid=6c2e9120dcff6e0b83698c4aa7be929a
GOOD LINK: CODE
http://jasamza.korisnik.com/forums/viewtopic.php?f=19&t=7&sid=6c2e9120dcff6e0b83698c4aa7
be929a copy pasted &....
Questions About Xml, Xhtml
(3) Hi, I like to know briefly about XML , XHTML and can be they be in replacement of MYSQL/MYSQL for
data storage?....
Help With Css/html Layout
Horizontal List Problems (5) I can't figure out why this horizontal list isnt working. Underneath my banner is supposed to
be a green gradient bar with a list of links in the center of the page. The links are all the way
to the left and are really small. The banner is also overlapping the list for some reason. This is
my current layout(don't worry, I'm not trying to advertise).
http://www.stormgaming.net/stormcreations/ This is my CSS file
http://www.stormgaming.net/stormcreations/storm.css Thanks in advance for any help.....
Create A Xhtml, Css3 Valid Gallery With Javascript ;part 1
(0) What were making In this tutorial, we will be creating a web page that can be used for a gallery, an
easy way of showing your portfolio of works or photography, etc. The page will be coded in XHTML
1.0 Strict and CSS3 valid, our CSS won't even have any warnings on them apart from one. So the
first thing we need to do is set up a base structure for the XHTML. Below is the code for this.
HTML html xmlns =" http://www.w3.org/1999/xhtml "> head > meta http-equiv ="
Content-Type " content=" text/html; charset=iso-8859-1 " /> title >XHTML & CSS Galler....
Help With Website Layout Correction For All Browsers
Page gets larger on Firefox 2 (4) If you go to my site at http://boozkerstweaks.trap17.com and you look at the home page everything
is fine on all browsers. Problems start to arise very soon however. Here is my list of problems and
i was wondering if someone could help with just whats wrong. I have done a HTML validator and found
only 3 errors and all these problems still occured. You might find more now though because i am
screwing around with the code. Here is the list of browsers and errors: Netscape 8.1: After you
click on the pulldown menu and click the only tweak avaible at the moment the pag....
Wml / Xhtml ?
for wap (6) wml/xhtml who gvs more facilities to make a wap-community site?....
Need Free Help With Upgrading Websites For Church
Must be versed in XHTML and CSS (4) I recently helped a Father Andreas of the Ukrainian Orthodox Church in Denver revamp his
websites. He was happy enough that he passed on the information about my help to a friend. I have
received this e-mail, but I am unable to do much since I am not educated in XHTML and only know
basic CSS (still learning). QUOTE I want to update my websites from HTML with tables to XHTML
with Style Sheets. All of my websites are for my Church, the Hellenic Orthodox Traditional Church.
Would you be able to assist me with this project? In Christ! Symeon of Denver If....
Embed Tag Valid In Xhtml 1.0 Strict?
(2) Is it? If not, could anyone reccommend how to get round it?....
Sending Forms To A Different Location
(5) Need some help, i have been out of the HTML programming for a while, and it isn't coming back
very fast for me, or this isnt possible. Can i send the contents of a form to a different place
then where the browser goes. I would like to send the contents of a form to a page where it will
take the data and process it, basically putting all the data into a SQL table and creating a new
file for the article. I want the user to go to a different page though, actually, back to the same
form where they put in the information in the first place. Possible? ....
Xhtml Strict Method For Submit/reset Buttons As An
(1) What's the proper way to handle submit and reset buttons? Using type submit and reset don't
allow you to replace the default button with an image, using the type image doesn't allow a
button to automatically act like a submit or reset....so far as I know. So How should I do this
when I want to use a custom image as the button? Code will be best way to explain, thanks! ....
Encoding And Xhtml Requirements
(2) OK, so after reading a lot of contradicting information I decided to ask. How should document
encoding be announced? The W3C validator (or at least links from the same upon a missing encoding)
suggests the server should send the encoding in the content-type header. The problem with this that
I see is that you can't always make a blanket judgment about what encoding pages will be in. Is
it simply suggested to use .htaccess files (or equivalent) for this, then? I am led to believe that
most (all?) browsers will ignore a content-type meta tag. Is there another in-file o....
Modify The Invision Skin Standards
about the xhtml (1) and hi, i just used the ipb1.3final.yeah.my skin is caliskinV6,got that from here ,since the cali3D
won't realease the new skin for IPB1.3 i just wanna to know if this is impossible,--modified the
skin to xhtml 1.0 or 1.1 standards. and you know the default skin of ipb is a comptnet,and the
Adding skin like CaliskinV6 is another comptnent,they are the different system,so i think there
would be the way to make the templates to xhtml stict. thank you,guangdian.....
What Is Xhtml
What Is It And Why Use It? (27) I was wondering what XHTML is because I have seen alot of sites that claim to be XHTML validated
rather than HTML validated. How does this compare to HTML? Why is it better? How hard is it to
master? How similar is it to HTML? Thank you for answering my questions! You should know by
now that What Is...? section is not to post question. Moving. Warning issued. ....
Header < H1> Layout Problem
only in IE? FF is okay. (13) The problem is best described as follows. The site in question has a four word Heading as a text
field, is contained in a div tag, and I tried using br tags to control the display of the words such
that the layout would follow a set pattern. ie: line 1 = 1word, line 2 = next two words, and line 3
= the last word. It seems like no matter what I do, Internet Explorer displays the words one line at
a time, one word on each line. Is this an IE problem? Firefox displays the Heading exactly as I
want, but IE doesn't even come close. CODE <div><h1>Word....
Strict Xhtml
target atribute (4) I have ran into this issue; Strict XHTML 1.0 does not support target atribute... so what should i
do? How will i use _blank pages with my stuff?....
Xhtml 1.1 Vs Xhtml 1.0
Whats the difference? (13) Is it only one type of xhtml 1.1 versus the three different types of xhtml 1.0 (strict,
transitional-loose, and frameset)? Is it 1.1 only strict? What are the differences or whats this
all about? I have heard something about xhtml 1.1 but have not actually seen one (not that i know at
least)... Thanks!....
Html Dom
standars compliance? (6) I just started reading about the tutorials in w3skulls about the HTML Document Object Model, and it
has a lot of objects that can be manipulated through java script. The thing is that most of these
objects are obsolete html tags, and im not sure if thats ok or should we stick anyway to the
standrs, and manipulate everything that fits the standar, like through the style object. Becouse,
if its not obsolete html, why will w3zkoolz have it there without notes about this issue of standars
compliance? Thanks!....
Xhtml Dtd
can you set it up? (5) Can you set up the document type definition in order to create your own tags in XHTML? (Just as it
happens with XML). I have been learning XML and DTD, and as i actually DO find it useful, i think
its even more useful the fact that a language (like HTML) already strongly accepted, has its own
structures defined. Its just sometimes you need to add a little adjustment here and there. So i
ask if theres a way to define this in XHTML, your structures of tags and attributes and all that. I
already know a coupple of sites which teach xhtml, but just have not found what i wa....
Order With Xhtml And Css
how do i improve (10) hi!, actually i'm working on one site for my grandma's vivarium, i have been researching
all kinds of features about xhtml and css and it rocks, but i have got a lot of problems with the
arrangement, alignement and possitioning, specially when the content of tables differs and i have to
create a new class, and then i have to reorder all the padding, marging, width and heights commands
or even worse, nesting!. I lose the control of the layout. ok the question here is if there is
any way of doing standard tables(with divs) of content or layouts structures,....
What Is The Xhtml 1.1 Code To Embed An Applet?
(2) I've been doing a lot of java stuff recently and some is pretty neat, so I'd like to put it
on the internet. I'm using XHTML 1.1 for all my pages, though, and according to W3Schools
doesn't exist anymore and to use object. It's not working, though. There are a bunch of
attributes ( http://www.w3schools.com/tags/tag_object.asp ) and I have no idea which things I need
to use. Which do I put for an applet?....
Substitute Form Button For An Image
homemade images in forms buttons (3) Hi, I have the next formular : CODE <form method='post'
action='index.php?mode=2&id=1'> <input type='hidden'
name='name' value='Canon Digital Ixus 700'/> <input
type='hidden' name='id' value='1'/> <input
type='hidden' name='qty' value='1'> <input
type='hidden' name='cost' value='40'> <input
type='submit' value='Add to ca....
Div Layout Problems
table in div not shrinking (5) Hey everyone. I am having an issue on one of my pages where the table inside my middle section of my
layout will not continue to shrink if the browser window is shrunk. AKA, i get a slider bar on the
bottom instead of things just overlapping. Below is the code for the page along with my style sheet.
If you want to see for yourself the problem just go here: Final Fantasy Fanatics - FF7 - Armor .
Armor.php CODE <?php session_start(); include './../db_connect.php';
include './../member_class.php'; include './../news_class.php&....
Code For This Table Layout?
html help needed (6) Hey, can anyone help me generate the code needed for a table that would look something like this?
CODE ----------------------------------------------------- |
|---------------- | | |---------------- | |
|---------------- | | |---------------- | |
|---------------- | |
|---------------- | ------------------------------------------------------ Thanks i....
Xhtml Concerns
just wondering (6) i been reading about it i got somewhat an understanding of it but how can you clearly define as
xhtml when all it really is a html redefined to the point that its just trimmed down and little bit
added here and there or its just the lack of understanding of it that confuses me. well of course
im wondering if anyone is using xhtml or still using html or a combo of both? of course i need some
more info w3c don't help out much.....
Web Page Layout?
(13) I am really struggling right now. I need help!!! Can anyone please tell me what the best
way to make web page layout is!!!! Please if you say any way, point me to the web
site where I can learn about it!!! Thanks:)....
Html And Xhtml
serving the right kind (11) Right now I have a site, which I've made XHTML 1.0 Strict. I am sending it as
application/xhtml+xml to browsers that say they can handle it, and as text/html to all other
browsers. Anyway, I started thinking that I'd much rather send proper HTML 4.01 to browsers that
don't understand XHTML instead of XHTML pretending to be HTML 4.01. It's not really a
problem with IE, because it is made to handle badly written sites, but who knows, some browser that
can handle HTML, but not XHTML, may be (correctly) parsing CODE <p> Hello <br />
World....
Wha's The Difference Between Xhtml 1.0 And 1.1?
(2) i learned xhtml 1.0 from w3 schools, but that was 1.0. what's new in 1.1? thanks in advance....
Looking for xhtml, forms, layout, standars
|
|
Searching Video's for xhtml, forms, layout, standars
|
advertisement
|
|