如何删除标题img下的空间

时间:2018-08-07 05:06:14

标签: css

无论我做什么,有人可以告诉我,页眉img下面有一个小缝隙。 这是我的CSS

.site-header {
position: relative;
border-bottom: 5px solid #121212;
padding: 0px !important;
margin: 0px !important;


}

我的网站 Gfx hideout

Ps在平板电脑上,所以我无权检查。 谢谢您的时间。

3 个答案:

答案 0 :(得分:1)

添加 display:block;到标题img

  

header img{display:block;}

答案 1 :(得分:0)

只需将display:block css添加到标题图片

这将删除img标记下面的空格,默认为display:inline

您看到的空间用于后代。对于“ y”,“ p”之类的字符保留该空间。

答案 2 :(得分:0)

我同意@Gautam Naik的观点,可以将图像CSS设置为void WordStats::ReadTxtFile(){ int pos=-1; string word; std::ifstream ifile(Filename); if(!ifile) { std::cerr << "Error Opening file " << Filename << std::endl; exit(1); } for (std::string word; ifile >> word; ) { transform (word.begin(), word.end(), word.begin(), ::tolower); word.erase(std::remove_if(word.begin(), word.end(), [](char c) { return (c < 'a' || c > 'z') && c != '\'' ; }), word.end()); if (word == "") continue; pos++; if (Dictionary.find(word) != Dictionary.end()) { Paragraph = KnownWords.find(word); //adding word to the knownWords if (Paragraph != KnownWords.end()) { Paragraph->second.push_back(pos); //adding position of the word } else { KnownWords[word] = vector<int>(1, pos); //adding record which is new } } else { Paragraph = UnknownWords.find(word); //adding word to the knownWords if (Paragraph != UnknownWords.end()) { Paragraph->second.push_back(pos); //adding position of the word } else { UnknownWords[word] = vector<int>(1, pos); //adding record which is new } } } cout << KnownWords.size() << " known words read." << endl; cout << UnknownWords.size() << " unknown words read." << endl; } void WordStats::DisplayKnownWordsStats() { vector<int>::iterator v; cout << "\n"; cout << setw(22) << "Word" << setw(12) << "Count" << setw(20) << "Position(s)" << endl; for (Paragraph = KnownWords.begin(); Paragraph != KnownWords.end(); Paragraph++) { string word = (*Paragraph).first; vector<int> vect = (*Paragraph).second; int count = vect.size(); cout << setw(22) << word << setw(9) << count ; cout << " "; for ( v = vect.begin(); v < vect.end(); v++) { cout << *v << " "; } cout << endl; } cout << "\n"; } ,但是另一个问题是您拥有:

display:block

在您的.site-header类内部,这对我来说没有多大意义,而且还会在您的标题图像,导航和内容div之间增加多余的空间。尝试删除它以测试我在说什么!