GetDotted Domains

Viewing Thread:
"CSS, Alligning an object right?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 29/05/04 at 16:14
Regular
"Digging!"
Posts: 1,560
Hey all,
I'm tying to get CSS to place a 2px line to the right side of the browser, but with no success.

#leftblack{
margin-top: 0px;
margin-left: 0px;
height: 100%;
width: 2px;
padding: 0px 0px 0px 0px;
background: #000000;
position: absolute;
}

The above code works to align a 2px line to the left side, so I assumed the following would align the line to the right, but it didn't.

#rightblack{
margin-top: 0px;
margin-right: 0px;
height: 100%;
width: 2px;
padding: 0px 0px 0px 0px;
background: #000000;
position: absolute;
}

I've tried using percentages for the left magin to align it right, but that doesn't work (depends on the size of the browser), so I'm not sure what to try now. Any ideas?

Cheers
S.A.

EDIT: Right, I've scrapped the border thingy, it effects the percentages to much. However, I still need to know how to align text vertically using CSS.
Sat 29/05/04 at 16:14
Regular
"Digging!"
Posts: 1,560
Hey all,
I'm tying to get CSS to place a 2px line to the right side of the browser, but with no success.

#leftblack{
margin-top: 0px;
margin-left: 0px;
height: 100%;
width: 2px;
padding: 0px 0px 0px 0px;
background: #000000;
position: absolute;
}

The above code works to align a 2px line to the left side, so I assumed the following would align the line to the right, but it didn't.

#rightblack{
margin-top: 0px;
margin-right: 0px;
height: 100%;
width: 2px;
padding: 0px 0px 0px 0px;
background: #000000;
position: absolute;
}

I've tried using percentages for the left magin to align it right, but that doesn't work (depends on the size of the browser), so I'm not sure what to try now. Any ideas?

Cheers
S.A.

EDIT: Right, I've scrapped the border thingy, it effects the percentages to much. However, I still need to know how to align text vertically using CSS.
Sat 29/05/04 at 16:42
Regular
"NULL"
Posts: 1,384
Unless I'm missing something, those two pieces of code are identical except for the name of the class. I'm a bit out of practise with coding at the moment - long time, no use - but I believe you can do it using the text-align property or right property, e.g.

text-align: right;

or

right: 0px;

With the latter method, you can increase the value to move it away from the edge, so if you want the line to be 10 pixels from the edge of the page, you could use:

right: 10px;
Sat 29/05/04 at 17:02
Regular
"Digging!"
Posts: 1,560
Nimco wrote:
> Unless I'm missing something, those two pieces of code are identical
> except for the name of the class.

Look again. One has the margin-right as 0px rather than the margin-left, which doesn't work.
Sat 29/05/04 at 17:03
Regular
"Digging!"
Posts: 1,560
Also, how do I align texts vertical position in an element, I want it at the base.
Sat 29/05/04 at 17:07
Regular
Posts: 10,364
It's be easier for a visual representation of what you are doing.

Whats your website URL?
Sat 29/05/04 at 17:07
Regular
"NULL"
Posts: 1,384
vertical-align: bottom;
Sat 29/05/04 at 17:19
Regular
"Digging!"
Posts: 1,560
Nimco wrote:
> vertical-align: bottom;

Doesn't work.
Sat 29/05/04 at 17:23
Regular
"Digging!"
Posts: 1,560
gamezfreak wrote:
> It's be easier for a visual representation of what you are doing.
>
> Whats your website URL?

http://timesplitters-futureperfect.port5.com/
Sat 29/05/04 at 18:56
Regular
"Digging!"
Posts: 1,560
Don't worry everyone, I've sorted it all out by using extra div tags.
Sat 29/05/04 at 19:31
Regular
"l33t cs50r"
Posts: 2,956
Nimco wrote:
> vertical-align: bottom;

Only works based on westher it's inheritance is from a block or inline element. Spent the last week studying verticle alignments in forms etc and it's actually quite confusing.

For instance, you have a search field in a div, you'd naturally assume that you would apply the verticle align to that div, but no, this doesn't work. You have to apply it to the input field as this is block element which the others will use to reference it's baseline...

Told you it was confusing.

As for the margin/line issue, your trying to align 2 divs next to each other on individual ID's. Divs are block elements, similar to p's ao there for will naturally push the other out of the way.

Have a look at this:
http://www.thenoodleincident.com/ [Space] tutorials/box_lesson/boxes.html

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Very pleased
Very pleased with the help given by your staff. They explained technical details in an easy way and were patient when providing information to a non expert like me.
Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.