473,386 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 4060
On 2 Apr, 16:25, Berlin Brown <berlin.br...@gmail.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
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...
7
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...
1
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,...
2
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...
9
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...
2
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...
11
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...
3
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...
0
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.