Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8593645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:02:24+00:00 2026-06-12T00:02:24+00:00

I have a button, which is a link, with a background image defined in

  • 0

I have a button, which is a link, with a background image defined in CSS.
The link is invisible, and there is no text as the button has all the graphic.
My problem is that the link (not the image, just the invisible link) expands at a 100% width and fills the whole screen, except for the height.

Complete Style Sheet. Dont mind some of the classes and ID’s, they are for other pages!

 body {
background-image: url("background.jpg");
font: 0.9em verdana, sans-serif;
}
#Upload {
    width: 30em;
    margin:auto;
    margin-top:10%;
    padding:0 3em 2em 2em ;
    border:1px solid #bbb;
    color: #333;
    background:white;
    font: 0.9em verdana, sans-serif;
    border-radius:10px;
}
#Upload label{
    float: left;
    width: 7em;
}
#Upload  a:link {
text-decoration:none;
font-size: 15px;
color:grey;
}#Upload  a:hover{
text-decoration:none;
font-size: 15px;
}
#Upload a:visited {
text-decoration:none;
color: black;
font-size: 15px;
}

.image{
background-color: white;
margin:auto;
border: 3px solid #bbb;
border-radius:10px;
}
.container{
width:100%;
}
a {
font-weight: bold;
text-decoration: none;
}
.button_skip{
background-image:url('button_upload.jpg');
background-repeat: no-repeat;
border-radius:10px;
border: 1px solid black;
width:190px;
height: 35px;
text-align: center;
line-height: 35px;
color:black;
margin:auto;
position:relative;
}
.button_home{
background-image:url('button_upload.jpg');
background-repeat: no-repeat;
border-radius:10px;
border: 1px solid black;
width:190px;
height: 35px;
text-align: center;
line-height: 35px;
color:black;
margin:auto;
position:relative;
}
.button_upload{
background-image:url('upload.png');
background-repeat: no-repeat;
width:272px;
height:107px;
border: 3px solid black;
border-radius:20px;
overflow:hidden;
}
.box{
width:272px;
display:BLOCK;
}


HTML (includes some php, it might cause the problem, dunnae)
<!DOCTYPE HTML>
<html>
<head>
<title>derp</title>
    <script src="cookie_image.js" type="text/javascript"></script>
    <script type="text/javascript">
    document.onReady=function(){
    setCookie("cookie_image",
    };
    </script>
    <link rel="stylesheet" type="text/css" href="stylesheet.css">   
</head>
<body>
<?php
function getImagesFromDir($path) { 
    $images = array(); 
    if ( $img_dir = @opendir($path) ) { 
        while ( false !== ($img_file = readdir($img_dir)) ) { 
            // checks for gif, jpg, png 
            if ( preg_match("/(\.gif|\.jpg|\.png)$/", $img_file) ) { 
                $images[] = $img_file; 
            } 
        } 
        closedir($img_dir); 
    } 
    return $images; 
} 

function getRandomFromArray($ar) { 
    // Hvis der ikke er vist billeder før er cookien ikke sat, så vi sætter den og returnerer
    if ( ! array_key_exists('cookie_image', $_COOKIE)) {
        $num = array_rand($ar);
        // Husk lige at sætte cookie, ups
        setcookie("cookie_image", $num, time() + 86400);
        return $ar[$num];
    }
    // Hvis cookie er sat har billeder været vist før så vi får ingen fejl
    mt_srand( (double)microtime() * 1000000 ); // php 4.2+ not needed 
    $num = array_rand($ar); 
    $last_image = explode(",", $_COOKIE["cookie_image"]);
    if (is_array($last_image)==false){
        $last_image = array(""); // HER DET ARRAY DER BLIVER GENERATED SOM LAVER EN ERROR HVIS DER IKKE ER NOGET I
    }
    while(sizeof ($last_image)< sizeof ($ar) and in_array($num, $last_image)){
        $num = array_rand($ar);
    } 
    if (sizeof ($last_image)< sizeof ($ar)) {
        array_push($last_image, $num);
    } else {
        $last_image = array();
    }
    setcookie("cookie_image", implode (",", $last_image), time() + 86400);
    //setcookie("cookie_image", "", time()+86400);
    return $ar[$num]; 
} 



///////////////////////////////////////////////////////////////////// 
// This is the only portion of the code you may need to change. 
// Indicate the location of your images  

$root = ''; 
// use if specifying path from root 
//$root = $_SERVER['DOCUMENT_ROOT']; 

$path = 'uploaded_files/'; 

// End of user modified section  
///////////////////////////////////////////////////////////////////// 

// Obtain list of images from directory  
$imgList = getImagesFromDir($root . $path); 
$img = getRandomFromArray($imgList); 
?>
<div class="container">

        <div class="button_upload_box">
<a href="upload.php" target="_self">
<div class="button_upload">
</div>
</a>

<div>
        <center><br><br>
<img style="max-width:600px; max-height:300px; min-width=100px; min-height:10px;" class="image" src="<?php echo $path . $img ?>" alt="Derp">
<br><br><br><br><br><br>
        </center>
        </div>
        <a href="index.php" target="_self">
        <div class="button_skip">
        Skip this image
        </div>
</a>
    </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:02:25+00:00Added an answer on June 12, 2026 at 12:02 am

    Clearly the first two I submitted were not what you were looking for but i think this is what you are trying to do:

    http://jsfiddle.net/Mutmatt/dBPnf/31/

    Text on top:

    http://jsfiddle.net/Mutmatt/dBPnf/46/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a user control (link) which has a label and a button.
I have template in which a button is created with a link using css,
I have disabled a link button and image button(which is inside a link button
I have a button which needs to get created dynamically but the problem is
I have this method defined since I will add a link button to each
I'm currently working on an application, i have this button which link to some
I have a link which triggers div tag to toggle. The problem is that
So I have this problem, which has never happened to me before. I am
I have a problem with stylize buttons in bootstrap. <div class=btn-group> <button class=btn btn-midd>Link</button>
I have button which post values of form to url but during post i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.