Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

?
Lv 4

How to move this text using CSS?

Look at the picture. I want to move the M on top on the final n in navigation

I tried using the W3Schools, but was unsuccessful. Help? .

Attachment image

1 Answer

Relevance
  • 6 years ago

    So, if I'm understanding you correctly, you want the M in 'My first..." on top of the 'N', right? The first thing you need to do is right click (mac - ctrl-click) on the blue title bar, and examine its CURRENT css. This is always a necessary first step when playing with CSS: find out what's already there.

    Judging from the picture, I'd assume the css is something like the following:

    #titleBar{

    text-align:center;

    background-color:#ccf;/*light pastel blue*/

    font-size:x-large;

    font-family:'impact';

    padding:15px;

    }

    So the only rule here we need to overwrite is "text-align".

    Change that to say "text-align:left;" (or just omit it).

    If you want the text in a SPECIFIC position, as you mention, you're going to need to put the text itself in its own div. So inside the #titleBar div, put another div (containing the actual text). I'll call that "#titleTxt"

    <div id='titleBar'><div id='titleTxt'>My First HTML/CSS Website</div></div>

    Next, for this inner div, do the following:

    #titleTxt{

    position:relative;/*without declaring a position 'type', you CANNOT move elements!*/

    left:20%;/*This is most likely wrong. adjust this number as necessary, or use px*/

    }

Still have questions? Get your answers by asking now.