Forum Moderators: open

Message Too Old, No Replies

HTML help re: positioning please

         

midi25

2:40 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



Hi i know a few basic commands in html like align etc. I have a form on my page that includes a dropdown box. It is allingned left and at the top of the page. I want to be able to position this dropdown on my page left but lower down. what html can i use to position this.

<form action="dummy" method="post">
<select name="choice" size="1" onChange="jump(this.form)" class="web">
<option value="http://www.asptestpilots.co.uk" selected>Home </option>
<option value="http://asptestpilots.co.uk">Info</option>
</select></form>

Knowles

2:42 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



You can always just use the simple <br /> err <br> if not using xhtml.
Or you can use CSS to postition it further down the page. I would be more than happy to tell you how but I cant remember CSS off the top my head for my life. Someone will be along shortly to help you there.

Sinner_G

2:52 pm on Jul 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or you could define a table:

<table border="0" cellspacing="0" cellpadding="0">
<tr height="200">
<td>&nbsp;</td>
</tr>
<tr><form action="dummy" method="post">
<select name="choice" size="1" onChange="jump(this.form)" class="web">
<option value="http://www.asptestpilots.co.uk" selected>Home </option>
<option value="http://asptestpilots.co.uk">Info</option>
</select></form>
</tr>
</table>

...where you replace the 200 height with the number of pixels you want your form to be down the page.

This may look more complcated than the <br> version, but it is then easier to try different heights.

Knowles

2:56 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



Its actually better than the BR for the rest the site. I forget about tables as I have stopped using them.

midi25

3:07 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



yeah thanks i may try a table. or the other thing i was gonna try was putting the code in between the layer tags in dreamweaver and just ajust the layers pixel positons.

Nick_W

3:23 pm on Jul 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



in your css...

select {
margin-top: 30px;
}

Try w3schools to learn a little more....

Nick

Purple Martin

11:48 pm on Jul 3, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tables are probably a bad idea. You're not even supposed to use height attributes in them :(. Go with Nick_W's css suggestion.

Sinner_G

7:13 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would not say that tables are a bad idea in general and I have often seen tables with height attributes. If you are not comfortable with it, then just use an invisible GIF.

Nick_W

7:20 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Invisible gifs? The worst possible thing you could use except for an invisible gif and a table.

Tables are for tabular data and invisible gifs are a waste of everybodys time. There are perfectly good ways of doing this elegantly and with good cross-browser results.

Just because you've seen heights in tables doesn't make it right, I see <font> tags all the time but they're so useles (and dont exsist in receent specs) it's not even amusing.

I wouldn't use them though!

If you're just starting out, get into good coding practices from the start. Use the right tools for the job and avoid the <insert shabby editor of choice> nonsense: An intimate understanding of the technology you use is essential if you really want to build useful websites that look good too ;)

Nick

Sinner_G

7:33 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I'm not just 'starting out'. I still think tables and invisible pics are very useful when you want to keep your code simple. For an advanced user, of course style sheets are a nicer way to do the job, but you have to be an advanced user.

Also style sheets are less useful for position when a site has very different pages.

Nick_W

7:48 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Sinner_G,

I wasn't really refering to you, but to the original poster.

I'd argue though that keeping code simple is definatley not tables/invisible gifs. Keeping code simple is what css/xhtml is all about. In fact, it's almost the entire point.

Advanced user? I'm as simple as they come (ask my wife) ;)

Nick

rewboss

8:51 am on Jul 4, 2002 (gmt 0)

10+ Year Member



Well, CSS isn't that hard. That said, CSS-P positioning is a nightmare for cross-browser compatibility, and the workarounds necessary often end up making the CSS so long and complex, that you end up with larger files.

I'd love to be able to use CSS-P all the time. But it just won't work unless I ignore significant proportions of my audience or resort to a series of ugly hacks.

I don't quite understand why "transparent GIFs are a waste of everybody's time". Not an ideal solution -- far from ideal, in fact -- but often the only reasonable one. I realized this the first time I tried a text-book example of "cross-browser compatible CSS positioning" which worked perfectly in MSIE, but showed up in Netscape 4 as something that looked like the cat had been sick (and it was about 500 pixels off screen as well). And no, there were no errors in the code.

Now, I'm all for CSS in principle. But I find it unnecessary to pour scorn over other solutions that many people (including me) have found to be more reliable. I'm trying to get to grips with CSS-2, but until Microsoft, Netscape and the others get their act together, I'm extremely wary of using it in a production environment and will use whatever works.

Sorry, but I'm a pragmatist.

papabaer

10:23 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello rewboss, with the primary exception of NN4, CSS positioning can be used reliably across browsers and in a wide variety of applications. Cross browser testing is still required, but only to fine tune the styles in order to account for a few rendering variations.

There us a great deal possible using the CSS1 & CSS2 style rules that are currently commonly supported. NN4 however is so buggy that it is best not even to consider using positioning for this browser. The @import rule can help here. Get comfortable with CSS positioning now; learn to use the tools.

rewboss

6:04 am on Jul 5, 2002 (gmt 0)

10+ Year Member



That's the point, isn't it? I have to be NS4 compatible. So yes, I'm trying to get to grips with CSS-2 because it is a good thing and once 99% of browsers out there actually do it properly, it'll be the best thing since ZX BASIC's string slicers (remember those? Genius!). Until then, I'm using transparent GIFs in tables in a production environment. Because they work.