Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
jQuery Mobile
alkiviadis
center image inside button, inside grid box
in
jQuery Mobile
•
11 years ago
<div class="ui-grid-b">
<div class="ui-block-a">
<div class="test" data-role="button">
<a href="#teachers" data-transition="pop" >
<img src="img/User.png" class="menu_img" ></img>
</a>
</div>
</div>
.....
</div>
.menu_img {
display: block;
margin:0 auto;
}
.test {
max-width: 80px;
max-height: 80px;
margin-top: auto;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
}
Hello all, above is my code. Basically i'm making a menu (first page) where i use grid layout to position
the buttons.Then i just want a button in every block that has an image in it. But i can't center the image
in the button. Any ideas? Thank you for your time and interest.
Alkiviadis
1
Replies(2)
voidaudio
Re: center image inside button, inside grid box
11 years ago
Try adding the image as the background.
<div class="ui-grid-b">
<div class="ui-block-a">
<div class="test" data-role="button">
<a href="#teachers" data-transition="pop" class="menu_img" ></a>
</div>
</div>
.....
</div>
.menu_img {
display: block;
margin:0 auto;
background-image: url(
"img/User.png"
);
background-position:center;
background-clip:content-box;
background-size: contain;
background-repeat: no-repeat;
}
Leave a comment on voidaudio's reply
alkiviadis
Re: center image inside button, inside grid box
11 years ago
It's been a while that i posted this question so i've implemented in a different way. But i will give this a go.
I didn't know of the
background-size: contain;
Thank you very much for your time!
Leave a comment on alkiviadis's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to alkiviadis's question
Top
Reply
{"z8322053":[14737000003088068,14737000003089281],"z8683913":[14737000003091380]}
Statistics
2
Replies
5157
Views
0
Followers
Tags
Cancel
menu
button
gridview
img
center
Actions
Permalink