Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS and button problem

Featured Replies

Hi!

How can i make this work? I have chopped up an image that is like a toolbar and i want to put the 4 pieces together like they were, but i am make the 2nd and 4th image clickable (they will make a callbakc to the server). The buttons fall down and are displayed underneath everything else, breaking up the design!

 

 


<style type="text/css">

    .btn
    {
     display:block;
      float:left;
    }


    .searchAndEmailSignUp
    {
    width:457px;
    height:34px;
     border: 0px solid green;
    }
      .searchArea
    {
     height: 34px;
    float:left;      
     border: 0px solid blue;
    }

      .searchhTextArea
    {
       background-image: url("styles/img/SEARCH_01.jpg");
     height: 34px;
    width: 202px;
    border: 0px dashed fuchsia;
    float:left;
    }

    .searchhButton
    {
     height: 34px;
     height:inherit;
       width: 25px;
    border: 0px dashed blue;
    }

      .emailSignUpArea
    {
     height: 34px;
    float:left;
     border: 0px solid orange;
    }         

   .emailLabel
   {
   height:34px;
   width:199px;
       background-image: url("styles/img/SEARCH_03.jpg");
   float:left;
   }

   .emailSignUpButton
   {

   }

   </style>

..........................

<div style="width:700px;  margin:auto; display:block; border:red solid 1px;">



   <div class="searchAndEmailSignUp">
   <div class="searchArea">
   <div class="searchhTextArea"></div>
   <div class="searchhButton">

       <input type="image" name="ImageButton1" id="ImageButton1" class="btn" src="Styles/img/SEARCH_02.jpg" style="border-width:0px;" /></div>
   </div>

   <div class="emailSignUpArea">
   <div class="emailLabel"></div>
   <div class="emailSignUpButton">
       <input type="image" name="ImageButton2" id="ImageButton2" class="btn" src="Styles/img/SEARCH_04.png" style="border-width:0px;" /></div></div>
   </div>


So you have two images "SEARCH_02.jpg" and "SEARCH_04.jpg" and you want them to be click-able yes?

 

What do you mean they fall down? Can you provide a screen-shot please :tv (2):

 

My first answer right-off the bat would be to add a position attribute as follows:

 

.btn

{

display:block;

float:left;

position:absolute;

left: ENTER YOUR PIXEL AMOUNT HERE;

top: ENTER YOUR PIXEL AMOUNT HERE;

}

 

Thinking about it, that might not work unless you actually apply that positioning method to the other pieces of your layout.

 

Someone will probably give you a better response than I but I guess this could be something worth looking at :blush1:

 

Let us know how you get on.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.