PowerApps HtmlText Common CSS Adjustments

PowerApps HtmlText Common CSS Adjustments

Dcoration

Div Full Screen

.box {
background:red;
position:absolute;
top:0px;
right:0px;
bottom:0px;
left:0px;
}

Center Horizontally and Vertically

  • not so good methods (won’t work on PowerApps)
  • Using tables
  • <table> <tr> <td> Centered content </td> </tr> </table>
  • table { width: 100%; height: 100%; } td { vertical-align: center; text-align: center; }
  • Using FlexBox
  • <div>Centered content</div>
  • div { display: flex; align-items: center; justify-content: center; }
  • Suggested method which works on Powerapps correctly:
  • Using translations
  • <div>Centered content</div>
  • div { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

Button Width Fit to The Text

Troubleshooting CSS

/* CSS */
.button-30 {
align-items: center;
appearance: none;
background-color: #FCFCFD;
border-radius: 4px;
border-width: 0;
box-shadow: rgba(45, 35, 66, 0.4) 0 2px 4px,rgba(45, 35, 66, 0.3) 0 7px 13px -3px,#D6D6E7 0 -3px 0 inset;
box-sizing: border-box;
color: #36395A;
cursor: pointer;
display: inline-flex;
font-family: "JetBrains Mono",monospace;
height: 48px;
justify-content: center;
line-height: 1;
list-style: none;
overflow: hidden;
padding-left: 16px;
padding-right: 16px;
position: relative;
text-align: left;
text-decoration: none;
transition: box-shadow .15s,transform .15s;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
white-space: nowrap;
will-change: box-shadow,transform;
font-size: 18px;
}

Background Opacity CSS

<p style='
position: absolute;
text-align: center;
background-color: transparentize(#e3e3e3,0.5);
z-index: 1;
'>
<i>You will be transfered to the external app <b>WFO</b></i>
</p>
<p style='
position: absolute;
text-align: center;
background-color: #e3e3e3;
opacity: 0.5;
'>
<i>You will be transfered to the external app <b>WFO</b></i>
</p>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store