Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

center an image horizontally and vertically

.center{
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}
Comment

css horizontal and vertical center image in div

.center-img {
	margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

// if that does not work you can try
.center-img {
	margin-left: auto;
	margin-bottom: auto;
	margin-top: auto;
	margin-right: auto;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to set a vector 3 variable in csharp 
Csharp :: c# getasynckeystate mouse 
Csharp :: draw sphere gizmo unity 
Csharp :: c# math to radiant 
Csharp :: unity gameobject teleporting 
Csharp :: check if string is email c# 
Csharp :: asp.net c# write string to text file 
Csharp :: convert string array to int c# 
Csharp :: how t remove a component in unity 
Csharp :: c# preprocessor if not 
Csharp :: c# center text 
Csharp :: how to clear console in c# 
Csharp :: c# AllowSynchronousIO to true 
Csharp :: asp.net data annotations Datetime 
Csharp :: c# how to simulate mouse click 
Csharp :: how to do a foreach loop in c# for dictionary 
Csharp :: c# wait seconds 
Csharp :: c# set a guid 
Csharp :: Csharp cast string to double 
Csharp :: Error inflating class android.support.constraint.ConstraintLayout 
Csharp :: unity scriptable object 
Csharp :: unity print 
Csharp :: c# socket bind to localhost 
Csharp :: compute months c# 
Csharp :: require admin pervillages c# 
Csharp :: wpf label text color rgb string 
Csharp :: c# get file extension 
Csharp :: unity get direction from one point to another 
Csharp :: c# print array 
Csharp :: add tablelayoutpanel dynamicly to winform in c# 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =