0
I’m having trouble accessing one class within another. I have the function Banner
:
import React from 'react';
import './Banner.css';
function Banner(props) {
return (
<div className="Banner">
<div className="Conteudo">
{props.titulo}
</div>
<div className="Footer">
{props.children}
</div>
</div>
)
};
export default Banner
Various Banners are organized within the Component AutoAtendimento
:
import React from 'react';
import Banner from './Banner.jsx';
import './AutoAtendimento.css';
function AutoAtendimento() {
return (
<div className="AutoAtendimento">
<Banner className="Cliente" titulo="Sou Cliente">
Clique aqui para acessar suas informações
</Banner>
<Banner className="Associado" titulo="Sou Associado">
Clique aqui para fazer login como Associado
</Banner>
</div>
)
};
export default AutoAtendimento;
In my css AutoAtendimento.css
I want to manipulate some characteristics of className="Cliente"
that’s inside className="AutoAtendimento"
. So I try to access it like this:
.AutoAtendimento .Cliente {
background-image: url('../../media/associado-vermelho.png');
background-color: blue;
}
But nothing changes, no error message appears, what the reason?
Virgilio, I noticed you created a property
title
inBanner
and withinAutoAtendimento
assignedtitulo="Sou Cliente/Associado"
. and nottitle="Sou Cliente/Associado"
. But that didn’t bring any trouble.title
is a reserved word?– yoyo
@Yoyo is a simple props! dê uma lida https://reactjs.org/docs/components-and-props.html
– novic
@Yoyo this property was not used, I did as example same ...
– novic