How to create a “placeholder” for DIV that act like textfield?

Here is a pure CSS only solution:- <div contentEditable=true data-ph=”My Placeholder String”></div> <style> [contentEditable=true]:empty:not(:focus):before{ content:attr(data-ph) } </style> Here, we basically select all contentEditable <divs> that are empty & blurred. We then create a pseudo element before the CSS selection (the editable div) and fix our placeholder text (specified the data-ph attribute) as its content. If … Read more

Swap placeholder text based on resolution (media query)

As a pure CSS solution, we could have two <input>s – having different placeholders – which are shown in different screen sizes – Example here: input.large { display: inline-block; } input.small { display: none; } @media (max-width: 399px) { input.large { display: none; } input.small { display: inline-block; } } <input type=”email” name=”email[]” class=”required email … Read more

Changing font-family for placeholder

In case someone want the placeholders selectors for all browsers : .mainLoginInput::-webkit-input-placeholder { font-family: ‘myFont’, Arial, Helvetica, sans-serif; } .mainLoginInput:-ms-input-placeholder { font-family: ‘myFont’, Arial, Helvetica, sans-serif; } .mainLoginInput:-moz-placeholder { font-family: ‘myFont’, Arial, Helvetica, sans-serif; } .mainLoginInput::-moz-placeholder { font-family: ‘myFont’, Arial, Helvetica, sans-serif; }

How to create WPF usercontrol which contains placeholders for later usage

ContentControls & ItemsControls are good for this, you can bind them to a property of your UserControl or expose them. Using a ContentControl (for placeholders in multiple disconnected places): <UserControl x:Class=”Test.UserControls.MyUserControl2″ xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ Name=”control”> <Grid> <Button>Just a button</Button> <ContentControl Content=”{Binding PlaceHolder1, ElementName=control}”/> </Grid> </UserControl> public partial class MyUserControl2 : UserControl { public static … Read more

How to avoid automatic focus on first input field when popping a HTML form as a JQuery dialog?

What I did was I created an extra input and made it invisible (style=”display:none”) then gave it the property autofocus=”true” put this at the end of your dialog content so it wont mess with anything. it should look like this: <div><!–dialog div–> <button></button> <button></button> <input type=”hidden” autofocus=”true” /> </div>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)