Jump to content

Разметка элементов


marc
 Share

Recommended Posts

Привет, есть задание сверстать по макету вот эту часть, что на фото, это лучше сначала сделать общий блок, потом блок с текстом и блок с изображением? Есть такой код для текста:

<section id="about">
		<div class="container">
			<div class="title">
				<h2>
					About Us
				</h2>
				<p>
					Lorem ipsum dolor sit amet, consectetur.
				</p>
			</div>
			<div class="about clearfix">
				<div class="about_txt">
					<h3 class="left">July 2010 <span>Our humble beginnings</span></h3>
					<p class="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente molestiae dolore sit sunt aspernatur quae.</p>
					<img src="img/about1.jpg" alt="">
				</div>
			
			</div>
		</div>
	</section>
.about{
	margin-top: 86px;
}

.about_txt{
	width: 300px;
	direction: rtl;
}

.about_txt h3{
	float: right;
	font-size: 18px;
	font-weight: bold;
	text-transform: uppercase;
}

.about_txt span{
	display: block;
	font-size: 18px;
	font-weight: bold;
	text-transform: capitalize;
}

.left{
  	margin-top: 25px;
  	float: left;
  	text-align: right;
}

.about_txt:after{
  	content: '';
  	display: table;
  	clear: both;
}

А как быть с изображением?

v1.png

Link to comment
Share on other sites

  • 4 months later...

Я бы так сделал. 
Ну а картинку блоком так и ставите:
 

<div>
  <div class="about_txt"> // <— тут 35%
    <h3 class="left">July 2010 <span>Our humble beginnings</span></h3>
    <p class="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente molestiae dolore sit sunt aspernatur quae.</p>
  </div>
  <div class="image-block"> <— тут 30%
    <img src="img/about1.jpg" alt="">
  </div>
  <div class="class"></div> <— тут 35%
</div>

 

 

v1.png.jpg

ps: проценты сами подберете...

 

 

Edited by Колхозник деревенский
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy