HELP:Marking up a letter

Hi, I am facing issue with applying css to the time element in the HTML. I have added the class attribute to both the address and time but the time does not get formatted.
html:
20 January 2016
css:
.sender-column {
text-align: right;
}

Unable to attach files as new user, copying it here.

<meta charset="utf-8">

<meta name="author" content="Ravikiran">

<meta name="description" content="Markup a letter- assignment">

<title>MyLetter</title>

<link rel="icon" href="./favicon.jpg" type="image/x-icon">

<link rel="stylesheet" href="./styles/letter-style.css">
<p><address class="sender-column">

    <strong>Dr. Eleanor Gaye</strong><br>

    Awesome Science faculty<br>

    University of Awesome<br>

    Bobtown, CA 99999,<br>

    USA<br>

    Tel: 123-456-7890<br>

    Email: no_reply@example.com<br>

</address><br>

<time class="sender-column">20 January 2016</time>

<br><address>

    <strong>Miss Eileen Dover</strong><br>

    4321 Cliff Top Edge<br>

    Dover, CT9 XXX<br>

    UK<br>

</address>

<h1>Re: Eileen Dover university application</h1>

Dear Eileen,<br>

    Thank you for your recent application to join us at the University of Awesome's science faculty to study as part of your <abbr title="Doctor Of Philosophy">PhD</abbr> next year. I will answer your questions one by one, in the following sections.

    

    <h2>Starting dates</h2>

    

    We are happy to accommodate you starting your study with us at any time, however it would suit us better if you could start at the beginning of a semester; the start dates for each one are as follows:

    <ol>

    <li>First semester: 9 September 2016</li>

    <li>Second semester: 15 January 2017</li>

    <li>Third semester: 2 May 2017</li>

    </ol>

    Please let me know if this is ok, and if so which start date you would prefer.

    

    You can find more information about important university dates on our website.

            

    <h2>Subjects of study</h2>

    

    At the Awesome Science Faculty, we have a pretty open-minded research facility — as long as the subjects fall somewhere in the realm of science and technology. You seem like an intelligent, dedicated researcher, and just the kind of person we'd like to have on our team. Saying that, of the ideas you submitted we were most intrigued by are as follows, in order of priority:

    <ol>

    <li>Turning H2O into wine, and the health benefits of Resveratrol (C<sub>14</sub>H<sub>12</sub>O<sub>3</sub>.)</li>

    <li>Measuring the effect on performance of funk bassplayers at temperatures exceeding 30°C (86°F), when the audience size exponentially increases (effect of 3 × 10<sup>3</sup> increasing to 3 × 10<sup>4</sup>.)</li>

    <li>HTML and CSS constructs for representing musical scores.</li>

    </ol>

    So please can you provide more information on each of these subjects, including how long you'd expect the research to take, required staff and other resources, and anything else you think we'd need to know? Thanks.

            

    <h2>Exotic dance moves</h2>

    

    Yes, you are right! As part of my post-doctorate work, I did study exotic tribal dances. To answer your question, my favourite dances are as follows, with definitions:

    <dl>

    <dt>Polynesian chicken dance</dt>

    <dd> little known but very influential dance dating back as far as 300BC, a whole village would dance around in a circle like chickens, to encourage their livestock to be "fruitful".</dd>

    <dt>Icelandic brownian shuffle</dt>

    <dd>Before the Icelanders developed fire as a means of getting warm, they used to practice this dance, which involved huddling close together in a circle on the floor, and shuffling their bodies around in imperceptibly tiny, very rapid movements. One of my fellow students used to say that he thought this dance inspired modern styles such as Twerking.</dd>

    <dt>Arctic robot dance</dt>

    <dd>An interesting example of historic misinformation, English explorers in the 1960s believed to have discovered a new dance style characterized by "robotic", stilted movements, being practiced by inhabitants of Northern Alaska and Canada. Later on however it was discovered that they were just moving like this because they were really cold.</dd>

    </dl>

    For more of my research, see my exotic dance research page.

    

    Yours sincerely,

    Dr Eleanor Gaye

    

    University of Awesome motto: "Be awesome to each other." -- The memoirs of Bill S Preston, Esq</p>

CSS
body {

max-width: 800px;

margin: 0 auto;

}

.sender-column {

text-align: right;

}

h1 {

font-size: 1.5em;

}

h2 {

font-size: 1.3em;

}

p,ul,ol,dl,address {

font-size: 1.1em;

}

p, li, dd, dt, address {

line-height: 1.5;

}

Hi, ravikiranbs

I had the same issue since the time is an inline element and in order to align its inner text all the way to the right we need to give it full width so apply this CSS ruleset to your CSS file and it will work just fine.

time.sender-column {
display: inline-block;
width: 100%;
}

Hi @ravikiranbs and welcome to the community :wave:

The source code isn’t meant to be uploaded here. You should put it into an online editor as described at the end of the task page and post a link here:

If you would like your work assessed, or if you get stuck and want to ask for help:

  1. Put your work in an online shareable editor such as CodePen, jsFiddle, or Glitch.
    …

This way we can see the code live in action which makes it much easier for us to assess it.

Regarding you question about the “sender-column” class:

  • You should remove the <p> tag around the address, because <address> itself is already a block element
  • You should add <p> tags around <time> and use the class on those <p>, because <time> is an inline element as @Junaid_Ali already mentioned (Thank you :blush:).

I’m happy to go through the rest of your code, when you have posted a link where I can view it online :slightly_smiling_face:

Have a nice day!
Michael

1 Like

Thanks a lot Junaid for the help, it worked.

1 Like

Thank you, Michael. sure, i would upload the source code, since i am new user i was denied the permission to upload.

I think you misunderstood me. Not uploading the code here. You can go to https://codepen.io/pen and put your HTML and CSS there. Then just share the link here.
This is an example of another user who asked for an assessment: Assessment wanted: for Typesetting a community school homepage

I hope this makes it clearer. Feel free to ask if you have questions. :slightly_smiling_face:
Good Luck!
Michael