I’m married to a US citizen. Can I get a green card if I crossed the border to get into the US?
‘Yes. Crossing the border—which is a certain type of illegal entry to the US—will not prevent you from getting a green card if you meet other requirements.
The most important other requirements are (1) that your US citizen or Lawful Permanent Resident spouse or parent will suffer extreme hardship if you don’t get the green card and (2) that you have an approved I-130, I-140, or I-360 petition or that you have been selected for the diversity visa.
If you can meet those requirements, you may be eligible for a green card even if you entered the US by crossing the border “without inspection”/ illegal entry. You will need to go through a multi-step, multi-year process that will end with you leaving the US for an appointment at a US Embassy or Consulate in your home country or other country outside the US.