Changing placeholder text with CSS only I am building one of those contact forms that are conversational. I have code that works but I don't think it is optimal (at the bottom). The form looks like: 



The code is live on this codepen

The problem I was solving was that the placeholder text on one of them is very large and would either break into two lines or if I gave it a fixed width, it would break the layout of smaller mobile phones. Yes, I understand the the very simple solution would be to propose a change to the copy for any instance, but going on the fact that it cannot be done, how would I solve swapping the text based on the device width.

My proposed solution was to reduce the text on mobile. Since there they are more flexible with the mobile product, I can make these changes, but the desktop needs to comply with the PSD.

HTML

&lt;input type="text" id="org" name="" placeholder="ORGANIZATION OR COMPANY NAME"&gt;


CSS

#org{
  display: block;
  width: 96%;
  margin: 0 auto;
}
@media only screen and (min-width: 768px) {
  #org{
    display: inline-block;
    width: 360px;
  }
}


It needs to be at least 360px to match the PSD for desktop. 

One other option that I have is if I have entirely different inputs, would that work? like 

&lt;input type="text" id="org" class="orgm" name="" placeholder="ORG/COMPANY"&gt;
&lt;input type="text" id="org" class="orgd" name="" placeholder="ORGANIZATION OR COMPANY NAME"&gt;


.orgm { //mobile
    display: block;
}
.orgd {
    display: none;
}
@media only screen and (min-width: 768px) {
  .orgm{
      display: none;
      width: 96%;
      margin: 0 auto;
  }
  .orgd {
      display: inline-block;
      width: 360px;
      margin: 0;
  }
}
I think that you are mistaking the purpous of the placeholder attribute.

A label element should be used to indicate what the field is for and a placeholder should provide an example of the format to use.

When you use a seperate label you have much more flexability in how you style it. You can use a "label as placeholder" pattern, where you place the 
label on top of the input so it appeares to be the placeholder. You would have to move the label when the input is focused.

In the snippet below I have created two lable's for the input. It would be very easy to show and hide based on a media query.

&lt;label for="org" class="show-for-large"&gt;Organization or Company Name&lt;/label&gt;
&lt;label for="org" class="show-for-small" hidden&gt;Org/Company&lt;/label&gt;
&lt;input type="text" id="org" name="" placeholder="Code Review"&gt;