dポイントプレゼントキャンペーン実施中!

この記述の左上の画像を右にずらしたい時は、どういった記述をすれば右に寄せれますか?
分かる方お願いします。




<body>
<div style="background-color: #dcdcdc;">
<hr color="red" size="3">
<img
style="float: left" src="
http://gameapp-5ap.com/wp-content/uploads/2020/0 …
width="100" height="100">
</body></html>

<font size="3">
<strong>
14文字までのタイトル
</font>


<font size="3">

<strong>
14文字以降のタイトル
</strong>
</font>
</font>




<font size="1">
基本無料
</font>



<font size="1">
17文字までのジャンル
</font>
<h6>
<font size="4">
<span>
<font color=#ff0000>
<strong>
見出し
</strong>
</font>
</h6>
<div align="center">
<div class="movie-wrap">
<video width="280" height="250" playsinline="" autoplay="" muted="" loop="">
<source src="
http://gameapp-5ap.com/wp-content/uploads/2020/0 …
">
</video>
</div>
</div>
</div>
</div>
</span>

「この記述の左上の画像を右にずらしたい時は」の質問画像

A 回答 (2件)

-こういち-さん


・・・・・画像を右にずらしたい・・・・・・・・・

ソースがぐちゃぐちゃなので基本を復習して、根本的に直したほうが良いですが、
取り敢えずは、ご参考に↓
http://www.tohoho-web.com/wwwbeg.htm

<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8" />
</head>
<body>
<div style=" background-color: #dcdcdc; ">
<hr color="red" size="3">
<img style="float: left; margin-left:50px; " src="http://gameapp-5ap.com/wp-content/uploads/2020/0 … width="100" height="100"><!-- ここのmargin-left:**px; をいじる -->
<font size="3">
<strong>
14文字までのタイトル
</strong>
</font><br>
<font size="3">
<strong>
14文字以降のタイトル
</strong>
</font><br>
<font size="1">
基本無料
</font><br>
<font size="1">
17文字までのジャンル
</font><br>
<h6>
<font size="4">
<font color=#ff0000>
<strong>
見出し
</strong>
</font>
</font><br>
</h6>
<div align="center">
<div class="movie-wrap">
<video width="280" height="250" playsinline="" autoplay="" muted="" loop="">
<source src="http://gameapp-5ap.com/wp-content/uploads/2020/0 …
</video>
</div>
</div>
</div>
</body>
</html>
    • good
    • 0
この回答へのお礼

有難う御座います。
自分はhtmlはじめて、今2週間位なんですが、
本当自分でも分かるくらい無茶苦茶な記述です。
色々勉強になりました。
後もう一つわからない所がありまして、基本無料と17文字までのジャンルの文字をもうちょっと上下の間隔を縮める場合は、どういった記述をしたらいいですか?
宜しかったら、お願いします

お礼日時:2020/02/21 10:49

こんにちは



なんだか全体の構文がどうなっているのかわかりませんが・・・
(早々にbody、htmlの終了タグがあって、その後にごちゃごちゃ続いている)
一度、htmlのチェックをなさった方が宜しいのではないかと。
http://www.htmllint.net/html-lint/htmllint.html

>画像を右にずらしたい時は~~
少し右にずらすのか、右端に寄せるのかでも変わってきますが、
単純に文字(タイトル)と入れ替えるような感じで良いとするなら、

 <img style="float: left" ~~
    ↓ ↓ ↓
 <img style="float:right;" ~~

で、宜しいのでは?
(文章は回り込みのままで、画像が親要素の右端に寄せられます)
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!