0

I've been trying for more than 24 hours to do something extremely easy, or I believe its easy. I'm not a programmer however I need to do this university and Ive tried looking for ways to make it work but it simply refuse to work.

I need to write a kanji character on the left, 3 kanjis character on the right aligned with the one on the left and responsive as well, if I increase the font size everything gets messed up and 4 small paragraphs aligned with the stuff above.

body {
  background-color: burlywood;
  font-weight: 400;
  color: #333;
  padding: 1em;
  margin: 0;
}

#test {
  float: left;
  display: block;
  font-size: 50px;
  margin-right: 30px;
}

article {
  margin-top: 20px;
  margin-left: 20px;
}

#parag {
  display: block;
}
<p id="test">屋</p>

<article>
  <p>漢</p>
  <p>漢</p>
  <p>漢</p>
</article>

<div id="parag">
  <p>gds asdgsa asdkjasd askjdnaksd akjsd </p>
  <p>gds asdgsa djgsadjh</p>
  <p>gds asdgsa djgsadjh</p>
  <p>gds asdgsa djgsadjh</p>
</div>

What I get is this

for some reason the paragraph does not start at the begging of the page! Can someone PLEASE help me?

Mohammad Faisal
  • 2,144
  • 15
  • 26
Marcell
  • 3
  • 2

2 Answers2

1

Try this

body {
background-color: burlywood;
font-weight: 400;
color: #333;
padding: 1em;
margin: 0; }

  #test {
      float: left;
      display: block;
      font-size: 50px;
      margin-right: 30px;
}

  article {
    margin-top: 20px;
    margin-left: 20px;
  }

  #parag {
      clear:both;
      display: block;
  }
<p id="test">屋</p>

    <article>
        <p>漢</p>
        <p>漢</p>
        <p>漢</p>
    </article>

<div id="parag">
    <p>gds asdgsa asdkjasd askjdnaksd akjsd </p>
    <p>gds asdgsa djgsadjh</p>
    <p>gds asdgsa djgsadjh</p>
    <p>gds asdgsa djgsadjh</p>
</div>

you just need to add clear:both in #parag css

0

It will be better using flex to get your desired output; simply wrap your letters inside a div and remove the float element you have placed on it.

body {
background-color: burlywood;
font-weight: 400;
color: #333;
padding: 1em;
margin: 0; }

.kanji {
  display:flex;
  align-items:center;
}

 #test {
   font-size: 50px;
   margin-right:20px;
}


  
  
<div class="kanji">
  <p id="test">屋</p>
  <article>
    <p>漢</p>
    <p>漢</p>
    <p>漢</p>
  </article>
</div>


<div id="parag">
    <p>gds asdgsa asdkjasd askjdnaksd akjsd </p>
    <p>gds asdgsa djgsadjh</p>
    <p>gds asdgsa djgsadjh</p>
    <p>gds asdgsa djgsadjh</p>
</div>
MattHamer5
  • 1,431
  • 11
  • 21