Jump to content

Direction Problem


ballouta

Recommended Posts

Hello

 

I tried to modify my css many times but nothing is working, I hope this can be solved easily here.

I am trying to edit an HTML page to write in the white space. If i write any english word/sentence, it works perfect... (direction ltr as known)

you may see a live preview here: www.dmcpublisher.com/Store

If i just make the (text-align: right), the text goes out of the white space where it should stay inside! I want to add arabic text which begins from right to left.

live preview: www.dmcpublisher.com/Store/index2.html

 

Many thanks

Link to comment
Share on other sites

There is also a shorthand margin property, which is great if you're setting each side differently. The sequence is clockwise from the top — top, right, bottom, left.

 

div {margin: 20px 0px 100px 10px; }

 

Note that there are just spaces between the values, no semicolons.

not sure what only 2 rules go for i normally would use 0s to fille all for if using shorthand code

Link to comment
Share on other sites

If the shorthand is used, and a value is left out, CSS fills it in using the values that exist. Here are some examples.

 

This:

 

margin: 10;

 

Is the same as this:

 

margin: 10 10 10 10;

 

Since left, bottom, and right are missing, it sets all the values to the one value that exists - ten.

 

Next, this:

 

margin: 10 20;

 

Is the same as this:

 

margin: 10 20 10 20;

 

Since the top value is set to ten, and the bottom value is missing, it sets the bottom value to the same as the top value - ten. Since the left value is missing, it sets the left value to the same as the right value - 20.

 

Next, this:

 

margin: 10 20 30;

 

Is the same as this:

 

margin: 10 20 30 20;

 

Since the left value is missing, it sets the left value o the same as the right value - thirty.

 

Edit: So for the OP - he had a left padding of 25 pixels, but nothing set for the top, right, and bottom padding. I gave code that set the top and bottom padding to zero, and the right padding the same as the left padding - 25 pixels.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.