有没有办法只在文本区域中选择小写字母?
我想将文本区域中小写字母的颜色更改为红色,并将大写字母保留为黑色。
答案 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;
}
元素来实现这一目标。因为:
你能做什么:
textarea
属性来替换contenteditable
:https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable textarea
事件上)。