- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试修复一个个人网站元素,其中我的图像拒绝以移动/平板电脑屏幕尺寸为中心。我已经尝试了各种自定义 css 但无济于事。我有很多不同大小的媒体查询,但是我找不到任何冲突的样式。我在这个元素上使用 Bootstrap 框架。网址是here .
这是我的html
<div class="about">
<a name="abouty"></a>
<h1 class="text-center">About</h1>
<p class="text-center" id="myth">The man...The myth...The legend</p>
<article>
<div class="img-wrap">
<img id="pic" src=" http://goodedevelopment.com/images/selfie.JPG" alt="A picture of myself,one handsome devil">
</div>
<p class="bio">
Kyle Goode is a young, caffeine dependent, Nashville local. He went to school in a small town just West of Nashville where he met and married his high school sweetheart. It is in that small town that Kyle's passion for technology began.Kyle has been amazed
with technology and programming even as a child,from trying to read code and quickly realizing he couldn't read the long "words" it was making to taking apart the family computers, much to the chagrin of his parents. Though his adult life has
been spent in the medical field, Kyle is excited to begin transitioning his hobby and passion to his profession.
</p>
</article>
<div class="container" id="mine">
<h1 class="text-center" id="kyle">Kyle Goode-the man in bullet points</h1>
<ul class="text-left" id="profile">
<li>Good Samaritan</li>
<li>Prefers puns intended</li>
<li>Especially gifted napper</li>
<li>Devoted to both programming and Game of Thrones</li>
<li>Codes for fun</li>
<li>Making History</li>
<li>Goes into survival mode if tickled</li>
<li>Anxiously awaiting you to connect with him for projects.</li>
</ul>
</div>
</div>
这是我的 CSS,非常感谢您提供的所有帮助。
@media screen and (max-width: 767px)
#pic {
overflow: auto;
margin: auto;
position: absolute;
left: 0;
bottom: 157px;
right: 0;
}
@media screen and (max-width: 825px)
#pic {
width: 119%;
height: auto;
position: relative;
right: -209px;
top: 229px;
}
@media screen and (max-width: 965px)
#pic {
width: 130%;
height: auto;
position: relative;
right: -222px;
top: 264px;
}
@media screen and (max-width: 1040px)
#pic {
width: 133%;
height: auto;
position: relative;
right: -280px;
top: 231px;
}
@media screen and (max-width: 1100px)
#pic {
height: 315%;
width: auto;
position: relative;
right: 400px;
top: 6px;
}
@media screen and (max-width: 1199px)
#pic {
width: auto;
height: 388%;
position: relative;
right: 446px;
}
@media screen and (max-width: 1300px)
#pic {
height: 390%;
width: auto;
position: relative;
right: 436px;
}
@media screen and (max-width: 1450px)
#pic {
width: 295%;
height: auto;
}
#pic {
width: auto;
height: 348%;
position: relative;
top: 10px;
right: 415px;
}
.img-wrap img {
width: 100%;
}
img {
vertical-align: middle;
}
img {
border: 0;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
最佳答案
你已经完成了媒体查询和相对定位。您提到了 Bootstrap,但几乎没有使用任何 Bootstrap 功能。
当涉及到您的关于我部分和使用 Bootstrap 时,我会使用与此类似的标记:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-6 col-xs-offset-3 col-sm-4 col-sm-offset-0 col-sm-push-8 col-md-6 col-md-push-0">
<img class="img-responsive center-block" src="http://placehold.it/600x800/fc0/&text=pic">
</div>
<div class="col-xs-12 col-sm-8 col-sm-pull-4 col-md-6 col-md-pull-0">
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vehicula elit orci, vitae ultrices ex fringilla vel. Suspendisse potenti. Pellentesque ac nisi quis neque sodales feugiat.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vehicula elit orci, vitae ultrices ex fringilla vel. Suspendisse potenti. Pellentesque ac nisi quis neque sodales feugiat.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vehicula elit orci, vitae ultrices ex fringilla vel. Suspendisse potenti. Pellentesque ac nisi quis neque sodales feugiat.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vehicula elit orci, vitae ultrices ex fringilla vel. Suspendisse potenti. Pellentesque ac nisi quis neque sodales feugiat.</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vehicula elit orci, vitae ultrices ex fringilla vel. Suspendisse potenti. Pellentesque ac nisi quis neque sodales feugiat.</li>
</ul>
</div>
</div>
</div>
以上只是一个演示,您需要调整一些东西以满足您的特定需求,但应该可以让您到达需要的地方。
我用过 column resets , offsetting columns和 column ordering在各种视口(viewport)尺寸下实现所需的布局。
关于html - 图像不会固定在平板电脑屏幕尺寸和更小的中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40661126/
我的应用程序中有两个 Activity 。第一个 Activity 启动模式是 singleInstance,第二个 Activity 启动模式是 singleTask。我正在使用这些启动模式,因为我
据热心网友投稿,小米小爱触屏音箱Pro 8外观曝光,可以看到触控屏幕尺寸比较大,像是在音箱上“长”了一个平板。 从曝光的信息来看,小米小爱触屏音箱Pro 8具有白色的配色设计,下方有一个长
我有一张 table ,看起来像, VisitorId date deviceType 1 2018-12-11 mobile 2
今天下午,小米官方公布了小爱触屏音箱Pro 8,可以看到触控屏幕尺寸比较大,音箱上“长”了一个平板。据悉,小米小爱触屏音箱Pro 8具有白色的配色设计,下方有一个长条状的扬声器,上方带有一个尺寸比较
有没有办法检测是否使用手持浏览器(iOS/Android 手机/平板电脑)? 我尝试这样做的目的是让手持设备上的浏览器中的元素宽度减半,但这并没有什么不同。 width: 600px; @media
目前,Google Analytics for web 公开了一个设备类别字段,其离散值为mobile、tablet 和desktop。该界面还允许您更深入地了解它的具体设备。我想 Google 有某
我是一名优秀的程序员,十分优秀!