Text is not getting on right side

Images
Related searches

Trying out hands on simple HTML. Want to put the sender address on the right side of the page but <p style="text-align: right;">fails.

I tried the solution form Mozilla MDN and other basic blogs on HTML and CSS, but failed to get a solution.

here is my code:

body {
  height: 297mm;
  width: 210mm;
  margin-left: auto;
  margin-right: auto;
  border-style: solid;
  border-width: 1px;
}

h3 {
  padding: 0px;
  margin: 0px;
}

p {
  margin-left: 105mm;
}
<!DOCTYPE html>

<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="author" content="Python Buddha" />
  <link rel="stylesheet" href="styles.css">
  <title>Letter</title>
</head>


<p style="text-align: right;">
  <h3>Dr. Eleanor Gaye</h3>
  Awesome Science faculty<br> University of Awesome<br> Bobtown, CA 9999<br> USA
  <br>
  <strong>Tel</strong>: 123-4567890<br>
  <strong>E-mail</strong>:no_reply@example.com<br>
  <time datetime="">20 January 2016</time>
</p>

<h3>Miss Eileen Dover</h3>
4321 Cliff Top Edge<br> Dover, CTC XXX<br> UK
<br>

</body>

</html>

And there you go simple code:

body {
  height: 297mm;
  width: 210mm;
  margin-left: auto;
  margin-right: auto;
  border-style: solid;
  border-width: 1px;
}

h3 {
  margin-bottom: 0px;
}

.sender {
  text-align: right;
}
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="author" content="Python Buddha" />
  <link rel="stylesheet" href="styles.css">
  <title>Letter</title>
</head>

<body>
  <div class="sender">
    <h3>Dr. Eleanor Gaye</h3>
    Awesome Science faculty<br> University of Awesome<br> Bobtown, CA 9999<br> USA
    <br>
    <strong>Tel</strong>: 123-4567890<br>
    <strong>E-mail</strong>:no_reply@example.com<br>
    <time datetime="">20 January 2016</time>
  </div>
  <div>
    <h3>Miss Eileen Dover</h3>
    4321 Cliff Top Edge<br> Dover, CTC XXX<br> UK
    <br>
  </div>

</body>

</html>

Setting text at right side of screen, Note : Text should not be at the right side of screen. It should be till the right side of the horizontal line. Any idea how to get this done? Another displaying how it is shown on the Windows 10 Mail App, where some of the text on the right hand side is missing and a third where I zoomed out and the text is still missing. If you look at the top line of the text you will see that in the original email there is quite a lot of text after the word "manufacturers", which is not displayed

I get emails that don't fit in window. Text right side doesn't show , All of text message does not fit within window. Specifically: I can't see text on right side of screen. Scrolling to right is not available. Please tell� On the Home tab, in the Paragraph group, click Align Left or Align Right. Center the text horizontally between the side margins Select the text that you want to center.

put <p> inside div tag

body{
      height: 297mm;
      width: 210mm;
      margin-left: auto;
      margin-right: auto;
      border-style: solid;
      border-width: 1px;
}

h3{
  padding: 0px;
  margin: 0px;
}

p{
  margin-left: 105mm ;
}
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <meta name="author" content="Python Buddha"/>
    <link rel="stylesheet" href="styles.css">
    <title>Letter</title>
  </head>

  <div style="text-align: right;">
  <p>
    <h3>Dr. Eleanor Gaye</h3>
    Awesome Science faculty<br>
    University of Awesome<br>
    Bobtown, CA 9999<br>
    USA<br>
    <strong>Tel</strong>: 123-4567890<br>
    <strong>E-mail</strong>:no_reply@example.com<br>
    <time datetime="">20 January 2016</time>
  </p>
  </div>

  <h3>Miss Eileen Dover</h3>
  4321 Cliff Top Edge<br>
  Dover, CTC XXX<br>
  UK<br>

  </body>
</html>

Alignment, font styles, and horizontal rules in HTML documents, For left to right text, the default is align=left , while for right to left text, the default or may be floated to one side of the page, temporarily altering the margins of text that Some alignment attributes also permit the "center" value, which does not� How to do it To align your text to the right side of a page, you first have to wrap your text in paragraph tag's. So, first, place a <P>tag (by the way stands for paragraph, obviously) in front of the text you want to align. Then at the end of the line of text you want to align, place an ending </P>tag.

you should store it on div tag.

 <div style="text-align: right">
   <h2>text-align: right:</h2>
 </div>

so it will be like this..

<div style="text-align: left; float: right;">
  <h3>Dr. Eleanor Gaye</h3>
  Awesome Science faculty<br> University of Awesome<br> Bobtown, CA 9999<br> USA
  <br>
  <strong>Tel</strong>: 123-4567890<br>
  <strong>E-mail</strong>:no_reply@example.com<br>
  <time datetime="">20 January 2016</time>
</div>

Structural markup and right-to-left text in HTML, How should I use the dir attribute to set text direction on structural elements in HTML? However, do not make the mistake of assuming that language declarations indicate directionality, On both of these browsers the scroll bar will appear to the left side of the window. character, the element will get a direction of rtl. Slideshow Slideshow Gallery Modal Images Lightbox Responsive Image Grid Image Grid Tab Gallery Image Overlay Fade Image Overlay Slide Image Overlay Zoom Image Overlay Title Image Overlay Icon Image Effects Black and White Image Image Text Image Text Blocks Transparent Image Text Full Page Image Form on Image Hero Image Blur Background Image

Use div instead of p.

<div style="text-align: right;">
  <h3>Dr. Eleanor Gaye</h3>
  Awesome Science faculty<br> University of Awesome<br> Bobtown, CA 9999<br> USA
  <br>
  <strong>Tel</strong>: 123-4567890<br>
  <strong>E-mail</strong>:no_reply@example.com<br>
  <time datetime="">20 January 2016</time>
</div>

Fixing right-to-left text in Microsoft Word, Most of these change the formatting to left-to-right text direction when users be accurate for those versions, but might not work with older versions. are), click the arrow at the right side and select “More Commands”. the original document was trying to get around the bug and make the text look normal. Place the 'right tab' on the ruler and adjust the tab 4. As you type you can now press 'tab' on your keyboard to start writing on either side of your Word document Having proper alignment of text

To unblock a number, tap the minus sign for each one on the right side of the screen. Reset your phone One easy way to troubleshoot your Samsung Galaxy S10 is to turn it off and on.

Definition and Usage. The right property affects the horizontal position of a positioned element. This property has no effect on non-positioned elements. If position: absolute; or position: fixed; - the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor.

Excel RIGHT function not working - reasons and solutions. If a Right formula does not work right in your worksheet, most likely it's because of one of the following reasons: There is one or more trailing spaces in the original data. To quickly remove extra spaces in cells, use either the Excel TRIM function or the Cell Cleaner add-in.

Comments
  • text-align: right is what you are looking for?
  • want to put send address on the right side of page!
  • just give a class to the p and add the clss to css
  • what about receiover address! it creates chaos onthe page. !
  • If you talk about horizontal scroll we can add width to control that.
  • how to render Miss Eileen..paragraph left aligned after (not on either side!) the receiver paragraph is the issue.
  • Okay now I got it. Just add this css "div + h3{clear:both}". You will get expected answer.Please check I also edited in the code.
  • it works but it provokes another paragraph receiver to come left side of it. So, div with appropriate class_name is good solution.
  • thanks, but still not rendered the text the way it should look!
  • How you want to make it look. Can you explain ?
  • all the text should start from same column. with divit gets bit unordered and space at beginning of each line makes the text not beautiful.
  • If it is works then please accept the answer so that other can get the working answer while anyone facing same issue
  • @PythonBuddha appreciate your thanks, it worked, but this is stackoverflow, make it flow, accept the answer mark it as correct