Need help with divs HELP!


#1

Ok, so I can get a div background going and can set height and width but I cant move the whole thing itself. All I want is to at least move it a few pixels to the right. Thanks in advance.


#2

Can you show is your code we can help you


#3

<!DOCTYPE html>

<title> My Website </title>

<body>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">PHP</a>
  </div>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">Ruby</a>
  </div>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">C++</a>
  </div>
  <div>
    <a id="Javascript" href="https://www.google.com/?gws_rd=ssl">Javascript</a>
  </div>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">HTML & CSS</a>
  </div>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">jQuery</a>
  </div>
  <div>
    <a href="https://www.google.com/?gws_rd=ssl">SQL</a>
  </div>

  <p>
  Hello! Welcome to Codex, a forum supporting a wide range of proggraming languages for all your questions and answers. You can get started by clicking on the tabs above. If you have any questions, please contact me at Mstavreff@outlook.com</p> <a id="Privacy"
  href="https://www.google.com/?gws_rd=ssl">Privacy Policy</a>
   <div id="Background">
   </div>    
</body>

div {
  background-color: #00ffdd;
  height: 38px;
  width: 81px;
  border: 1px solid #000000;
  float: right;
  text-align: center;
  font-family: Verdana;
  text-decoration: none
}

a {
  text-decoration: none;
  color: black;
}

p {
  font-family: verdana; 
  text-align: center;
  position: relative ;
  bottom: -150px;
  right: -50px;
}

#Privacy {
  color: blue;
  font-size: 12px;
  margin-left: 74px;
  position: relative;
  right: -70px;
  bottom: -200px;
  }

#Background {
  background-color: #2b9ef0;
  border:none;
  position: transparent;
  height:500px;
  width:2000px;
  display:
}

#4

In the div brackets add the margin property to change where the picture is, by doing each margin in this order:
top
right
bottom
left
do it by px (pixels) and add commas between each unit
Each unit will make it farther away from that direction, so the right will make the picture farther away from the right margin


#5

why would you want to remove it a few pixels to the right? You could simple remove the bodys margin if it is bugging you so much:

body {
  margin: 0;
}

#6

just in general how do I move it?


#7

I want to make my buttons static but they all gather in one place making it look like one button.


#8

well, i wrote this, it might help. But that does not include block vs display block.

what do you mean? Your code looks fine to me, be more specific


#9

srry I meant fixed! ok I put FIXED they will stack on top of each other and will only be one button


#10

float doesn't work on fixed elements, so instead you should use display: inline-block instead


#11

thanks for the help then. How do I mark this as solved?


#12

I marked it as solved