473,789 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Two rows of links, use of DIV, align to the right

This is a simple div/layout question. I could easily solve the
problem with a table, but I don't want to do that.

I have a row of links. I want row 1 to have links and row 2 to have
links. I want both to align such they are on the right (edge up to
the right).

Here is my code or one variation of it.

<div style="float: right; text-align: right;" id="row1">
My Links ...
</div>
<div style="float: right; text-align: right;" id="row2">
My Links ...
</div>

On a small resolution 1024x768. This works fine. The links show up
as I describe. Links to the right, one on one row and links on
another row.

As I increase the screen resolution and expand the browser, row1 shows
up on the right and row2 shows up on the left of row1. They are on
the same row.

I removed "float: right", but I couldn't position the links to the
right.
Apr 2 '08 #1
2 4097
On 2 Apr, 16:25, Berlin Brown <berlin.br...@g mail.comwrote:
I removed "float: right", but I couldn't position the links to the
right.
Floats are one problem, clearing after them is quite another!

Read <http://brainjar.com/css/positioning/>

You will probably have to modify your HTML and insert an element after
the <div>(s) such as <br>, <hr(my favourite) or even another <div>.
This element has CSS clear:right; applied to it. The trick is to
realise that you _do_ need to add some extra HTML element(s) to your
page as "hooks" on which to hang more CSS. CSS alone doesn't and
cannot handle the whole problem itself. You might see advice to work
around this problem with CSS :after & content: instead. I don't advise
that in practice, as it doesn't work on IE.

It's not quite conformant HTML to use <brhere (although commonly
done), and so I prefer the <hr>, even though I then need to use some
more CSS to stop it displaying. Some people prefer an anoymous <div>
instead, again with the CSS clear applied to it.
Posting a URL to an example generally encourages a better response
than posting fragments.
Apr 2 '08 #2
Berlin Brown wrote:
>
I have a row of links. I want row 1 to have links and row 2 to have
links. I want both to align such they are on the right (edge up to
the right).

<div style="float: right; text-align: right;" id="row1">
My Links ...
</div>
<div style="float: right; text-align: right;" id="row2">
My Links ...
</div>

As I increase the screen resolution and expand the browser, row1 shows
up on the right and row2 shows up on the left of row1. They are on
the same row.
Gotta wonder whether you should float anything at all, i.e. you've
decided on a solution (floating) before defining the actual problem.
Posting a URL showing the context would be better than a code snippet.

--
Berg
Apr 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
7857
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the rows on the top and bottom of the picture and image. I need to make the height of the rows to be the same as the textbox and image. How do I do this? I have tried even setting the height of the table and all the <td> and <tr> tags to 1 but have...
7
4729
by: Jonas Smithson | last post by:
Hello all, I have an absolute positioned parent div, and nested inside it is an absolute positioned child div -- I mean the div *code* is nested inside, but the child is physically positioned so that it's completely outside the parent div (to the left of its parent, in a left-side margin area). The child div contains hyperlinks. Explorer 6 (on Windows) has no problem with this. However, in Netscape 6, the links are unclickable. I...
1
1052
by: et | last post by:
I have a table that doesn't line up the way I want it to. I have 6 rows and 3 columns. The 3rd column spans the 6 rows and contains a grid. If the data in the grid has more than 6 rows of data, the other rows spread out vertically, as if there is extra space in there. I don't want that to happen, I want the 6 rows to be together as if there is no space between then. I have tried using height, valign, using a set height and using a...
2
1463
by: ameshkin | last post by:
I'm having all kinds of visual problems using dreamweaver's built in query builder. I have 4 different categories. Right. I want to show ten records from each category of items in a mysql database. All on the same page. Could someone tell me what is wrong with my code? The page is here http://www.picmonkey.com/MoreGraphics.php
9
5134
panachepad
by: panachepad | last post by:
I arrived here from a websearch that found this thread from your archives: http://www.thescripts.com/forum/thread97805.html It helped me to understand that I am on the right track, but I still have one problem surrounding this issue. I am trying to make a <div> block that contains a) a link b) an arrow or an image of an arrow c) another link d) another link floated off to the far right All of this must be on one horizontal line. The...
2
2072
by: Krustov | last post by:
The question of how to create thumbnails with clickable links gets asked on this newsgroup every so often - like clock work . Just really posing this script here for google to archive it & so users can be pointed to it in the future via a link to google groups . <html> <head>
11
3199
by: bharathmngl | last post by:
now iam trying to add rows dynamically into the table when i click "ADD ROW" button. It should also have the option to delete the selected row. So Please help me to find code.... And also please tell me how to add textarea and radiobutton in to the dynamically created rows.. Here is my code; <html> <head> <title>Untitled Document</title>
3
3928
by: nigelesquire | last post by:
Please help! I'm trying to clone and delete multiple rows with JavaScript. I need two delete buttons that work...! I only have one for now, but it's not working properly, the output count is messing up. Problems:
0
1481
by: geraldjr30 | last post by:
hi, i have the following: <html> <STYLE type="text/css"> TD{font-family:ARIAL;font-size:11px;color:#666666;}
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3703
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.