[Mobile Web] Fluid Layout -- Ex

SET WIDTH OF SIDEBAR

 

Using percentages, set the width for the .sidebar to the equivalent of 400px to 6 decimals. Remember, the context is the total width of the site which is 960px. Use the HTML and CSS Source tabs for more information. Use this Flexible Math tool to help.

.sidebar {
  width: 41.666667%; /*400px/960px;*/
}

 

SET WIDTH OF CONTENT

 

Using percentages, set the width for the .content to the equivalent of 575px. Remember, the context is the total width of the site which is 960px. Use this Flexible Mathtool to help.

.content {
  width: 59.89583333333334%; /* 575 / 960 */
}

 

DETERMINE THE CONTEXT #1

 

From the markup in the HTML Source, what is the correct context for the h1 element? Enter the CSS selector for the correct HTML element below.

<div class="container">
  <header>
    <h1>Journey Into Mobile</h1>
  </header>
  <div class="sidebar"></div>
  <div class="content"></div>
</div>

Answer: header

 

DETERMINE THE CONTEXT #2

 

From the markup in the HTML Source, what is the correct context for .content? Enter the CSS selector for the correct HTML element below.

<div class="container">
  <header>
    <h1>Journey Into Mobile</h1>
  </header>
  <div class="sidebar"></div>
  <div class="content"></div>
</div>

Answer: .container

 

CONVERT TO PERCENTAGE

 

From the CSS styles given, convert .content to a percentage. Give your answer to 6 decimals. Use this Flexible Math tool to help.

.content {
  width: 57.291667%; /* 550 / 960 */
}

 

SET MARGIN OF CONTENT

 

Using percentages, set the margin-right of .content to the equivalent of 380pxto 6 decimals. Determine the correct context by viewing the given HTML markup.

.content {
  margin-right:  39.58333333333333%; /* 380 / 960 */
}

 

SET PADDING OF CONTENT

 

Using percentages, set the padding of .content to the equivalent of 31px. Determine the correct context by viewing the given HTML markup. Give your answer to at least 7 decimals.

复制代码
.container {
  width: 960px;
}
.sidebar {
  width: 360px;
}
.content {
  width: 560px;
}
复制代码

Answer:

.content {
padding: 5.5357143%;
}

 

posted @   Zhentiw  阅读(264)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示