仅定位文字区

时间:2016-04-02 18:14:54

标签: css css-selectors

有没有办法只在文本区域中选择小写字母?

我想将文本区域中小写字母的颜色更改为红色,并将大写字母保留为黑色。

2 个答案:

答案 0 :(得分:1)

没有。使用CSS没有方法可以做到这一点。

答案 1 :(得分:1)

您无法使用#include <fstream> #include <utility> #include <algorithm> using namespace std; template<std::size_t N> struct immutable_string_type { typedef const char array_type [N+1]; static constexpr std::size_t length() { return N; } constexpr immutable_string_type(const char (&dat) [N + 1]) : _data { 0 } { auto to = _data; auto begin = std::begin(dat); auto end = std::end(dat); for ( ; begin != end ; ) *to++ = *begin++; } constexpr array_type& data() const { return _data; } char _data[N+1]; }; template<std::size_t N> constexpr immutable_string_type<N-1> immutable_string(const char (&dat) [N]) { return immutable_string_type<N-1>(dat); } int main() { ofstream file; file.open("test.txt"); constexpr auto test = immutable_string("this is a test \n to see if it breaks into a new line."); file.write(test.data(), test.length()); return 0; } 元素来实现这一目标。因为:

  • 您需要使用JS
  • 包装小写字母
  • textarea中的字符串不会被解释为代码而是文本,所以你会有类似的东西&#34;嘿,这是我的文字

你能做什么: