将HTML文本源编辑为CSS

时间:2016-11-03 21:04:42

标签: html css

我陷入了将HTML源代码中的文本编辑为CSS的简单任务。我希望有人可以帮助我确信有一个非常简单的答案。我遇到困难的原因是因为当我尝试查看我正在尝试编辑的网页的.css文件时,所有文本元素(如文本标题等)似乎都会从代码中省略。我对CSS一无所知,所以我很挣扎。

以下是HTML源代码:



<div>
  <label class='text-contrast'>Check-in</label>
  <input autocomplete='off' required type='text' id='cf-query-start_date' class=' date form-control' value='' data-alt='#alt_cf-query-start_date' data-datepicker='' />
  <input type='hidden' name='start_date' id='alt_cf-query-start_date' class='alt_date' value='2016-11-04'>
</div>
<div class='input-placeholder-group form-group mobile-browser mobidates end_date '>
  <label class='text-contrast'>Check-out</label>
</div>
&#13;
&#13;
&#13;

很简单,我想更改“办理登机手续”&#39;至日期范围&#39;并删除&#39;退房&#39;文本元素。需要使用CSS编辑器完成。

编辑:缺少div部分:

    <div class="container">
        <h2 class="text-jumbo text-contrast">REDACTED</h2>
                    <div class="sticker">
            <form method='get' action='/reserve' id='cf-query' class='search-area full form-inline' role='form'>    
        <input type='hidden' name='filter_item_id' id='filter_item_id' value='' />
        <input type='hidden' name='customer_id' value=''/>
        <input type='hidden' name='date' id='date' value='' />
        <input type='hidden' id='widget-arg-item_id' class='cf-widget-arg' name='item_id' value='' /><input type='hidden' name='category_id' id='category_id' value='0'/><input type='hidden' name='view' id='cf-query-view' value='H'/>
        <div class='search-form-input-wrapper'>
        <div class='input-placeholder-group form-group mobile-browser mobidates start_date '>

4 个答案:

答案 0 :(得分:1)

假设缺少的开始div看起来像<div class='input-placeholder-group form-group mobile-browser mobidates start_date '>你可以做

&#13;
&#13;
div.start_date label,       /*  this rule take out the Check-in/out labels  */
div.end_date label {
  display: none;
}
div.start_date::before {    /*  this rule add the Date Range  */
  content: 'Date Range'
}
&#13;
<div class="container">
  <h2 class="text-jumbo text-contrast">REDACTED</h2>
  <div class="sticker">
    <form method='get' action='/reserve' id='cf-query' class='search-area full form-inline' role='form'>
      <input type='hidden' name='filter_item_id' id='filter_item_id' value='' />
      <input type='hidden' name='customer_id' value='' />
      <input type='hidden' name='date' id='date' value='' />
      <input type='hidden' id='widget-arg-item_id' class='cf-widget-arg' name='item_id' value='' />
      <input type='hidden' name='category_id' id='category_id' value='0' />
      <input type='hidden' name='view' id='cf-query-view' value='H' />
      <div class='search-form-input-wrapper'>
        <div class='input-placeholder-group form-group mobile-browser mobidates start_date '>
          <label class='text-contrast'>Check-in</label>
          <input autocomplete='off' required type='text' id='cf-query-start_date' class=' date form-control' value='' data-alt='#alt_cf-query-start_date' data-datepicker='' />
          <input type='hidden' name='start_date' id='alt_cf-query-start_date' class='alt_date' value='2016-11-04'>
        </div>
        <div class='input-placeholder-group form-group mobile-browser mobidates end_date '>
          <label class='text-contrast'>Check-out</label>
        </div>
      </div>
    </form>
  </div>
</div>
&#13;
&#13;
&#13;

答案 1 :(得分:1)

隐藏结帐文字很简单:

// Custom color for navigation bar
UINavigationBar.appearance().tintColor = UIColor.whateverTintColorYouWant
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.whateverTextColorYouWant]

我们错过了包含第一个// Custom color for navigation bar mail.navigationController?.navigationBar.tintColor = UIColor.aColorYouwant mail.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.aColorYouWant] 元素的.end_date .text-contrast { display: none; } ,但可以根据第二个元素假设它具有类div(或类似) .text-contrast.start_date。因此,这应该可以用于更改显示的文本:

div

答案 2 :(得分:0)

如果您只能编辑CSS级别的内容,而您无法编辑HTML文件,那么唯一合理的方法是:

.text-contrast {
  display: none;
}
.text-contrast:after {
  content: 'Date range';
}

但请记住,它将适用于所有text-contrast元素,因此如果您在代码中有更多这些元素,那么您可能真的需要以某种方式更改HTML。

答案 3 :(得分:-2)

我认为最好显示和隐藏而不是删除,如你所见,我添加了类Shw,hdn

<label class='text-contrast Shw'>Check-in</label>
<label class='text-contrast Hdn'>Date Range</label>
            <input autocomplete='off' required type='text' id='cf-query-start_date' class=' date form-control' value='' data-alt='#alt_cf-query-start_date' data-datepicker=''/>
                <input type='hidden' name='start_date' id='alt_cf-query-start_date' class='alt_date' value='2016-11-04'>
        </div>
        <div class='input-placeholder-group form-group mobile-browser mobidates end_date '>
            <label class='text-contrast'>Check-out</label>