我有一个图像,我想在图像的右侧添加它的标题及其基本描述。我尝试使用position:relative,absolute。填充&保证金:0px。
链接是:URL
游戏" Rock,Paper,Scissors"和" Miji",游戏标题应该在右边的图像的顶部,然后在那之下我将添加游戏描述
谢谢!
答案 0 :(得分:1)
在页面上播放项目而不必弄乱特定的边距和填充(在繁忙的页面上可能会变得混乱)的一种简单方法是选择你的位置(相对,绝对等),然后使用左,右,并且顶部可以在页面上移动它。
例如
public static void main(String[] args) {
System.out.println("Usage : enter a, b, & c from a quadratic equation");
System.out.println(" aX^2 +bX + c = 0");
System.out.println(" Result will be 2 values for X");
Scanner in = new Scanner(System.in);
double a = 0;
double b = 0;
double c = 0;
double x1 = 0 ;
double x2 = 0;
double discriminant = 0;
System.out.println("Please enter values for a , b, and c ");
while(true){
try
{
a = in.nextDouble();
break;
}
catch(java.util.InputMismatchException E)
{
System.out.println("wrong input, try again");
}
}
while(true){
try
{
b = in.nextDouble();
break;
}
catch(java.util.InputMismatchException E)
{
System.out.println("wrong input, try again");
}
}
while(true){
try
{
c = in.nextDouble();
break;
}
catch(java.util.InputMismatchException E)
{
System.out.println("wrong input, try again");
}
}
//x1 = (-b+sqrt(b*b - 4ac))/2a
//x2 = (-b+sqrt(b*b - 4ac))/2a
discriminant = b*b -4.0 * a * c;
x1 = (-b + Math.sqrt(discriminant))/2.0*a;
x2 = (-b - Math.sqrt(discriminant))/2.0*a;
System.out.println("The two values for X are " + x1 + " and " + x2);
}
使用数字和位置类型,直到您充分了解它们如何影响项目,您应该没有问题调整页面上对象的位置。
答案 1 :(得分:1)
<a href="Games/RPS.html"><img src="Games/RPS.jpg" width="15%" height="15%" alt="Rock, Paper, Scissors"></a>
先拿这两个标签
<span id="gameTitle">Rock, Paper, Scissors, Shoot</span>
替换这些位置两个标签!
<span id="gameTitle" style=" float: left;">Rock, Paper, Scissors, Shoot</span>
将范围设为style="float: left";
在这些<br/>
和<a href....
<span id=....
答案 2 :(得分:1)
您好根据我的理解,您尝试下面这样的事情 https://jsfiddle.net/up1v5j0z/28/
<ul>
<li><div class="content"><img src="http://i.stack.imgur.com/FZVih.jpg?s=328&g=1" height="200px";><h4>Roshan Padole </h4><p>Senior Software Engineer and DigitalMarketing Experts</br>Management of the manpower with effective positive results. </p></div><br style="clear:both"></li>
</ul>
.content img {float:left}
[https://jsfiddle.net/up1v5j0z/28/][1]
希望这会对你有所帮助